Skip to content

Commit

Permalink
feat: add charset and max width for exported HTML (#69)
Browse files Browse the repository at this point in the history
* feat: add charset and max width for exported HTML
* fix: recovery format
  • Loading branch information
ocian authored Oct 16, 2021
1 parent 6774cce commit e15df5c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 91 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
Expand Down Expand Up @@ -40,4 +39,4 @@ yarn-error.log*
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?
169 changes: 81 additions & 88 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/assets/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export function exportHTML(htmlStr) {

downLink.download = "content.html";
downLink.style.display = "none";
let blob = new Blob([`<html><body>${htmlStr}</body></html>`]);
let blob = new Blob([
`<html><head><meta charset="utf-8" /></head><body><div style="width: 750px; margin: auto;">${htmlStr}</div></body></html>`,
]);

downLink.href = URL.createObjectURL(blob);
document.body.appendChild(downLink);
Expand Down

0 comments on commit e15df5c

Please sign in to comment.