Expand BOM prepending to text/*
Now you can save HTML and rely on the auto-BOM prepender
This commit is contained in:
+3
-3
@@ -1,6 +1,6 @@
|
||||
/* FileSaver.js
|
||||
* A saveAs() FileSaver implementation.
|
||||
* 2015-05-07
|
||||
* 2015-05-07.1
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: X11/MIT
|
||||
@@ -125,8 +125,8 @@ var saveAs = saveAs
|
||||
if (!name) {
|
||||
name = "download";
|
||||
}
|
||||
// prepend BOM for UTF-8 XML and text/plain types
|
||||
if (/^\s*(?:text\/(?:plain|xml)|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
|
||||
// prepend BOM for UTF-8 XML and text/* types (including HTML)
|
||||
if (/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
|
||||
blob = new Blob(["\ufeff", blob], {type: blob.type});
|
||||
}
|
||||
if (can_use_save_link) {
|
||||
|
||||
Reference in New Issue
Block a user