www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

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:
Mchrome/content/zotero/xpcom/data/item.js | 14+++++++++++++-
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(/&amp;/g, "&"); + otherNote = otherNote.replace(/&amp;/g, "&"); + thisNote = thisNote.replace(/&apos;/g, "'"); + otherNote = otherNote.replace(/&apos;/g, "'"); + thisNote = thisNote.replace(/&quot;/g, '"'); + otherNote = otherNote.replace(/&quot;/g, '"'); + thisNote = thisNote.replace(/&lt;/g, "<"); + otherNote = otherNote.replace(/&lt;/g, "<"); + thisNote = thisNote.replace(/&gt;/g, ">"); + otherNote = otherNote.replace(/&gt;/g, ">"); + changed = thisNote != otherNote; } catch (e) {