Skip to content

Commit

Permalink
fix: Use HTML DOMParser to parse html text. fixed #158
Browse files Browse the repository at this point in the history
  • Loading branch information
l0o0 committed Apr 11, 2023
1 parent cd28707 commit 5956c80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/content/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ Zotero.Jasminum.Utils = new function () {
this.string2HTML = function (text) {
// Use DOMParser to parse text to HTML.
// This DOMParser is from XPCOM.
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Components.interfaces.nsIDOMParser);
/* var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
.createInstance(Components.interfaces.nsIDOMParser); */
var parser = new DOMParser(); // Use HTML DOMParser #158
return parser.parseFromString(text, "text/html");
}.bind(Zotero.Jasminum);

Expand Down

0 comments on commit 5956c80

Please sign in to comment.