Removed UTF-8 BOM in download function
This commit is contained in:
		
							parent
							
								
									f27fc90a74
								
							
						
					
					
						commit
						5a212b9335
					
				@ -325,7 +325,7 @@ $(".ui-save-history").click(() => {
 | 
				
			|||||||
        const blob = new Blob([history], {
 | 
					        const blob = new Blob([history], {
 | 
				
			||||||
            type: "application/json;charset=utf-8"
 | 
					            type: "application/json;charset=utf-8"
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        saveAs(blob, `hackmd_history_${moment().format('YYYYMMDDHHmmss')}`);
 | 
					        saveAs(blob, `hackmd_history_${moment().format('YYYYMMDDHHmmss')}`, true);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -612,7 +612,7 @@ export function exportToRawHTML(view) {
 | 
				
			|||||||
    const blob = new Blob([html], {
 | 
					    const blob = new Blob([html], {
 | 
				
			||||||
        type: "text/html;charset=utf-8"
 | 
					        type: "text/html;charset=utf-8"
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    saveAs(blob, filename);
 | 
					    saveAs(blob, filename, true);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//extract markdown body to html and compile to template
 | 
					//extract markdown body to html and compile to template
 | 
				
			||||||
@ -644,7 +644,7 @@ export function exportToHTML(view) {
 | 
				
			|||||||
            const blob = new Blob([html], {
 | 
					            const blob = new Blob([html], {
 | 
				
			||||||
                type: "text/html;charset=utf-8"
 | 
					                type: "text/html;charset=utf-8"
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            saveAs(blob, filename);
 | 
					            saveAs(blob, filename, true);
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -1542,7 +1542,7 @@ ui.toolbar.download.markdown.click(function (e) {
 | 
				
			|||||||
    var blob = new Blob([markdown], {
 | 
					    var blob = new Blob([markdown], {
 | 
				
			||||||
        type: "text/markdown;charset=utf-8"
 | 
					        type: "text/markdown;charset=utf-8"
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    saveAs(blob, filename);
 | 
					    saveAs(blob, filename, true);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
//html
 | 
					//html
 | 
				
			||||||
ui.toolbar.download.html.click(function (e) {
 | 
					ui.toolbar.download.html.click(function (e) {
 | 
				
			||||||
@ -1922,7 +1922,7 @@ $('#revisionModalDownload').click(function () {
 | 
				
			|||||||
    var blob = new Blob([revision.content], {
 | 
					    var blob = new Blob([revision.content], {
 | 
				
			||||||
        type: "text/markdown;charset=utf-8"
 | 
					        type: "text/markdown;charset=utf-8"
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    saveAs(blob, filename);
 | 
					    saveAs(blob, filename, true);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
$('#revisionModalRevert').click(function () {
 | 
					$('#revisionModalRevert').click(function () {
 | 
				
			||||||
    if (!revision) return;
 | 
					    if (!revision) return;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user