fix 2.1b1-related field code corruption
This commit is contained in:
parent
abf3037a24
commit
925bc7ca5b
1 changed files with 7 additions and 2 deletions
|
@ -1259,11 +1259,16 @@ Zotero.Integration.Session.prototype.unserializeCitation = function(arg, index)
|
||||||
try {
|
try {
|
||||||
var citation = Zotero.JSON.unserialize(arg);
|
var citation = Zotero.JSON.unserialize(arg);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
// fix for corrupted fields
|
// fix for corrupted fields (corrupted by Word, somehow)
|
||||||
try {
|
try {
|
||||||
var citation = Zotero.JSON.unserialize(arg.substr(0, arg.length-1));
|
var citation = Zotero.JSON.unserialize(arg.substr(0, arg.length-1));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
throw new Zotero.Integration.CorruptFieldException(arg);
|
// another fix for corrupted fields (corrupted by 2.1b1)
|
||||||
|
try {
|
||||||
|
var citation = Zotero.JSON.unserialize(arg.replace(/{{((?:\s*,?"unsorted":(?:true|false)|\s*,?"custom":"(?:(?:\\")?[^"]*\s*)*")*)}}/, "{$1}"));
|
||||||
|
} catch(e) {
|
||||||
|
throw new Zotero.Integration.CorruptFieldException(arg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue