Strip control characters when displaying child notes as well
This commit is contained in:
parent
4ea05ce091
commit
2562e64e82
1 changed files with 7 additions and 1 deletions
|
@ -113,7 +113,13 @@ Zotero.Report = new function() {
|
||||||
// If not valid XML, display notes with entities encoded
|
// If not valid XML, display notes with entities encoded
|
||||||
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
||||||
.createInstance(Components.interfaces.nsIDOMParser);
|
.createInstance(Components.interfaces.nsIDOMParser);
|
||||||
var doc = parser.parseFromString('<div>' + note.note.replace(/ /g, " ") + '</div>', "application/xml");
|
var doc = parser.parseFromString('<div>'
|
||||||
|
+ 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, "")
|
||||||
|
+ '</div>', "application/xml");
|
||||||
if (doc.documentElement.tagName == 'parsererror') {
|
if (doc.documentElement.tagName == 'parsererror') {
|
||||||
Zotero.debug(doc.documentElement.textContent, 2);
|
Zotero.debug(doc.documentElement.textContent, 2);
|
||||||
content += '<p class="plaintext">' + escapeXML(note.note) + '</p>\n';
|
content += '<p class="plaintext">' + escapeXML(note.note) + '</p>\n';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue