From 78951c34ed8169d70f8fc841a3010ce19f6309d1 Mon Sep 17 00:00:00 2001 From: Matt Burton Date: Fri, 2 Oct 2009 03:23:54 +0000 Subject: [PATCH] Fixing broken regex in PubMed Central --- translators/PubMed Central.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/translators/PubMed Central.js b/translators/PubMed Central.js index 3b3898c94..8ee5082c0 100644 --- a/translators/PubMed Central.js +++ b/translators/PubMed Central.js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":100, "inRepository":true, - "lastUpdated":"2009-09-03 17:00:00" + "lastUpdated":"2009-10-01 23:22:00" } function detectWeb(doc, url) { @@ -44,6 +44,7 @@ function doWeb(doc, url) { next_link = links.iterateNext(); } items = Zotero.selectItems(items); + if(!items) return true; for (var i in items) { URIs.push(i); } @@ -74,7 +75,11 @@ function doWeb(doc, url) { } newItem.url = tags["fulltext_html_url"]; if (!newItem.url) newItem.url = tags["abstract_html_url"]; - newItem.extra = "PMCID:" + text.match(/PMCID: <\/span>(\d+)/)[1]; + try { + newItem.extra = "PMCID: " + text.match(/PMCID: <\/span>(PMC\d+)/)[1]; + } catch(e){ + + } newItem.journalAbbreviation = text.match(/span class=\"citation-abbreviation\">([^<]+)([^<]+)