commit c809dfcbc46b8f91e4732ddf6815d2d6ac067485
parent f0bd1e77ffab6dbc7fbd600dc1acc11844aa2e02
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date: Sun, 8 Feb 2015 19:43:36 -0600
Use only the first ISBN for CSL JSON
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git 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);