diff --git a/chrome/content/zotero/xpcom/report.js b/chrome/content/zotero/xpcom/report.js index d42735d50..d0435a7a2 100644 --- a/chrome/content/zotero/xpcom/report.js +++ b/chrome/content/zotero/xpcom/report.js @@ -113,7 +113,13 @@ Zotero.Report = new function() { // If not valid XML, display notes with entities encoded var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"] .createInstance(Components.interfaces.nsIDOMParser); - var doc = parser.parseFromString('
' + note.note.replace(/ /g, " ") + '
', "application/xml"); + var doc = parser.parseFromString('
' + + note.note + .replace(/ /g, " ") + // Strip control characters (for notes that were + // added before item.setNote() started doing this) + .replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g, "") + + '
', "application/xml"); if (doc.documentElement.tagName == 'parsererror') { Zotero.debug(doc.documentElement.textContent, 2); content += '

' + escapeXML(note.note) + '

\n';