www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit b5974570e8b2b37b6570e6a8127a5b523dcecf2e
parent 8b5fbe7e96672148c8ca201c7a307976cb960f29
Author: Matt Burton <mcburton@gmail.com>
Date:   Wed, 29 Apr 2009 18:08:34 +0000

Fixed DOI regex & added nicer fail message for crossref when DOI does not exist.

Diffstat:
Mtranslators/CrossRef.js | 5+++++
Mtranslators/DOI.js | 3+--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/translators/CrossRef.js b/translators/CrossRef.js @@ -37,6 +37,11 @@ function processCrossRef(xmlOutput) { // ensure status is valid if(!xml.doi_record.length()) return false; + // ensure this isn't an error + if(xml.doi_record.crossref.error.length()) { + throw xml.doi_record.crossref.error + return false; + } if(xml.doi_record[0].crossref.journal.length()) { var item = new Zotero.Item("journalArticle"); var itemXML = xml.doi_record.crossref.journal; diff --git a/translators/DOI.js b/translators/DOI.js @@ -11,8 +11,7 @@ "lastUpdated":"2009-04-07 15:48:00" } -//var DOIre = /(doi:)?\s*(10\.[\w.]+\/[^\/\s]+)/ig; -var DOIre = /doi:\s*(10\.[\w.]+\/[^\/\s]+)/ig; +var DOIre = /(?:doi:)?\s*(10\.[\w.]+\/[^\/\s]+)/igm; var items = {}; var selectArray = {};