commit 68715ed99f438efa19330680f17fbadaf0ec11d2
parent 431de84f9fea11d6df37a63989dc40d1a7871975
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 4 Apr 2011 11:03:28 +0000
Fix erroneous conflits due to encode XML entities
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git 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, "<p> </p>");
otherNote = otherNote.replace(re, "<p> </p>");
+ // 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) {