Add a couple comments
This commit is contained in:
parent
1c087270e3
commit
d3c4689973
|
@ -468,10 +468,13 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
doc = (new DOMParser()).parseFromString(result, "text/html");
|
doc = (new DOMParser()).parseFromString(result, "text/html");
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
// If DOMParser fails, use document.implementation.createHTMLDocument
|
// If DOMParser fails, use document.implementation.createHTMLDocument,
|
||||||
|
// as documented at https://developer.mozilla.org/en-US/docs/Web/API/DOMParser
|
||||||
if(!doc) {
|
if(!doc) {
|
||||||
doc = document.implementation.createHTMLDocument("");
|
doc = document.implementation.createHTMLDocument("");
|
||||||
var docEl = doc.documentElement;
|
var docEl = doc.documentElement;
|
||||||
|
// AMO reviewer: This code is not run in Firefox, and the document
|
||||||
|
// is never rendered anyway
|
||||||
docEl.innerHTML = result;
|
docEl.innerHTML = result;
|
||||||
if(docEl.children.length === 1 && docEl.firstElementChild === "html") {
|
if(docEl.children.length === 1 && docEl.firstElementChild === "html") {
|
||||||
doc.replaceChild(docEl.firstElementChild, docEl);
|
doc.replaceChild(docEl.firstElementChild, docEl);
|
||||||
|
|
|
@ -233,6 +233,8 @@ Zotero.QuickCopy = new function() {
|
||||||
for (var i=0; i<notes.length; i++) {
|
for (var i=0; i<notes.length; i++) {
|
||||||
var div = doc.createElement("div");
|
var div = doc.createElement("div");
|
||||||
div.className = "zotero-note";
|
div.className = "zotero-note";
|
||||||
|
// AMO reviewer: This documented is never rendered (and the inserted markup
|
||||||
|
// is sanitized anyway)
|
||||||
div.insertAdjacentHTML('afterbegin', notes[i].getNote());
|
div.insertAdjacentHTML('afterbegin', notes[i].getNote());
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
textContainer.appendChild(textDoc.importNode(div, true));
|
textContainer.appendChild(textDoc.importNode(div, true));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user