Don't throw an error on CSL_BIBLIOGRAPHY codes

This commit is contained in:
Simon Kornblith 2011-08-08 22:27:50 +00:00
parent b5b3d0a135
commit 176e2f2d05

View file

@ -1756,8 +1756,11 @@ Zotero.Integration.Session.prototype.restoreProcessorState = function() {
* Loads document data from a JSON object
*/
Zotero.Integration.Session.prototype.loadBibliographyData = function(json) {
var openBraceIndex = json.indexOf("{");
if(openBraceIndex == -1) return;
try {
var documentData = JSON.parse(json.substring(json.indexOf("{"), json.lastIndexOf("}")+1));
var documentData = JSON.parse(json.substring(openBraceIndex, json.lastIndexOf("}")+1));
} catch(e) {
try {
var documentData = JSON.parse(json.substr(0, json.length-1));