Skip to content

Commit 5a212b9

Browse files
committed
Removed UTF-8 BOM in download function
1 parent f27fc90 commit 5a212b9

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

public/js/cover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ $(".ui-save-history").click(() => {
325325
const blob = new Blob([history], {
326326
type: "application/json;charset=utf-8"
327327
});
328-
saveAs(blob, `hackmd_history_${moment().format('YYYYMMDDHHmmss')}`);
328+
saveAs(blob, `hackmd_history_${moment().format('YYYYMMDDHHmmss')}`, true);
329329
});
330330
});
331331

public/js/extra.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export function exportToRawHTML(view) {
612612
const blob = new Blob([html], {
613613
type: "text/html;charset=utf-8"
614614
});
615-
saveAs(blob, filename);
615+
saveAs(blob, filename, true);
616616
}
617617

618618
//extract markdown body to html and compile to template
@@ -644,7 +644,7 @@ export function exportToHTML(view) {
644644
const blob = new Blob([html], {
645645
type: "text/html;charset=utf-8"
646646
});
647-
saveAs(blob, filename);
647+
saveAs(blob, filename, true);
648648
});
649649
});
650650
}

public/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ ui.toolbar.download.markdown.click(function (e) {
15421542
var blob = new Blob([markdown], {
15431543
type: "text/markdown;charset=utf-8"
15441544
});
1545-
saveAs(blob, filename);
1545+
saveAs(blob, filename, true);
15461546
});
15471547
//html
15481548
ui.toolbar.download.html.click(function (e) {
@@ -1922,7 +1922,7 @@ $('#revisionModalDownload').click(function () {
19221922
var blob = new Blob([revision.content], {
19231923
type: "text/markdown;charset=utf-8"
19241924
});
1925-
saveAs(blob, filename);
1925+
saveAs(blob, filename, true);
19261926
});
19271927
$('#revisionModalRevert').click(function () {
19281928
if (!revision) return;

0 commit comments

Comments
 (0)