From c809dfcbc46b8f91e4732ddf6815d2d6ac067485 Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Sun, 8 Feb 2015 19:43:36 -0600 Subject: [PATCH] Use only the first ISBN for CSL JSON --- chrome/content/zotero/xpcom/utilities.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index 0e40eecb1..013919c96 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -1541,6 +1541,11 @@ Zotero.Utilities = { if (!value) continue; if (typeof value == 'string') { + if (field == 'ISBN') { + var isbn = value.match(/^(?:97[89]-?)?(?:\d-?){9}[\dx](?!-)\b/i); + if (isbn) value = isbn[0]; + } + // Strip enclosing quotes if(value.charAt(0) == '"' && value.indexOf('"', 1) == value.length - 1) { value = value.substring(1, value.length-1);