diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 3eb5a2b23..8c62501e5 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -3679,7 +3679,7 @@ Zotero.Item.prototype.diff = function (item, includeMatches, ignoreFields) { } if (thisData.note != undefined) { - // Whitespace normalization + // Whitespace and entity normalization // // Ideally this would all be fixed elsewhere so we didn't have to // convert on every sync diff @@ -3704,6 +3704,18 @@ Zotero.Item.prototype.diff = function (item, includeMatches, ignoreFields) { thisNote = thisNote.replace(re, "

"); otherNote = otherNote.replace(re, "

"); + // Unencode XML entities + thisNote = thisNote.replace(/&/g, "&"); + otherNote = otherNote.replace(/&/g, "&"); + thisNote = thisNote.replace(/'/g, "'"); + otherNote = otherNote.replace(/'/g, "'"); + thisNote = thisNote.replace(/"/g, '"'); + otherNote = otherNote.replace(/"/g, '"'); + thisNote = thisNote.replace(/</g, "<"); + otherNote = otherNote.replace(/</g, "<"); + thisNote = thisNote.replace(/>/g, ">"); + otherNote = otherNote.replace(/>/g, ">"); + changed = thisNote != otherNote; } catch (e) {