Skip to content

Commit

Permalink
fix(#7): InvalidCharacterError on HTML export
Browse files Browse the repository at this point in the history
  • Loading branch information
igorlogius committed Aug 1, 2023
1 parent 2f4f649 commit 9900c57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"options_ui": {
"page": "options.html"
},
"version": "1.3.11"
"version": "1.3.12"
}
5 changes: 2 additions & 3 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ async function exponLoad() {
expbtn.addEventListener("click", async function () {
try {
const data = (await browser.bookmarks.getSubTree(expfolders.value))[0];
console.debug(rec2HtmlStr(data));
const content = JSON.stringify(data, null, 4);
let dl = document.createElement("a");
const href =
Expand Down Expand Up @@ -220,7 +219,7 @@ async function exponLoad() {
console.debug("expbtnhtml");
try {
const data = (await browser.bookmarks.getSubTree(expfolders.value))[0];
const content = btoa(rec2HtmlStr(data));
const content = btoa(unescape(encodeURIComponent(rec2HtmlStr(data))));
let dl = document.createElement("a");
const href = "data:text/plain;base64;charset=utf-8," + content;
dl.setAttribute("href", href);
Expand Down Expand Up @@ -261,7 +260,7 @@ function rec2HtmlStr(bmTreeNode, level = 1) {
"</A>" +
"\n";
} else if (Array.isArray(bmTreeNode.children)) {
tmp = "\t".repeat(level) + "<DT><H3>" + title + "</H3>" + "\n";
tmp = "\t".repeat(level) + "<DT><H3>" + htmlEncode(title) + "</H3>" + "\n";
if (bmTreeNode.children.length > 0) {
out = out + tmp;
out = out + "\t".repeat(level) + "<DL><p>" + "\n";
Expand Down

0 comments on commit 9900c57

Please sign in to comment.