Don't throw an error on CSL_BIBLIOGRAPHY codes
This commit is contained in:
parent
b5b3d0a135
commit
176e2f2d05
1 changed files with 4 additions and 1 deletions
|
@ -1756,8 +1756,11 @@ Zotero.Integration.Session.prototype.restoreProcessorState = function() {
|
||||||
* Loads document data from a JSON object
|
* Loads document data from a JSON object
|
||||||
*/
|
*/
|
||||||
Zotero.Integration.Session.prototype.loadBibliographyData = function(json) {
|
Zotero.Integration.Session.prototype.loadBibliographyData = function(json) {
|
||||||
|
var openBraceIndex = json.indexOf("{");
|
||||||
|
if(openBraceIndex == -1) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var documentData = JSON.parse(json.substring(json.indexOf("{"), json.lastIndexOf("}")+1));
|
var documentData = JSON.parse(json.substring(openBraceIndex, json.lastIndexOf("}")+1));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
try {
|
try {
|
||||||
var documentData = JSON.parse(json.substr(0, json.length-1));
|
var documentData = JSON.parse(json.substr(0, json.length-1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue