Fix erroneous conflits due to encode XML entities
This commit is contained in:
parent
431de84f9f
commit
68715ed99f
|
@ -3679,7 +3679,7 @@ Zotero.Item.prototype.diff = function (item, includeMatches, ignoreFields) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thisData.note != undefined) {
|
if (thisData.note != undefined) {
|
||||||
// Whitespace normalization
|
// Whitespace and entity normalization
|
||||||
//
|
//
|
||||||
// Ideally this would all be fixed elsewhere so we didn't have to
|
// Ideally this would all be fixed elsewhere so we didn't have to
|
||||||
// convert on every sync diff
|
// convert on every sync diff
|
||||||
|
@ -3704,6 +3704,18 @@ Zotero.Item.prototype.diff = function (item, includeMatches, ignoreFields) {
|
||||||
thisNote = thisNote.replace(re, "<p> </p>");
|
thisNote = thisNote.replace(re, "<p> </p>");
|
||||||
otherNote = otherNote.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;
|
changed = thisNote != otherNote;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user