Merge pull request #171 from aurimasv/cleanDOI

Fix cleanDOI
This commit is contained in:
Simon Kornblith 2012-09-23 08:40:36 -07:00
commit 0c2b8e6016

View File

@ -261,8 +261,9 @@ Zotero.Utilities = {
if(typeof(x) != "string") {
throw "cleanDOI: argument must be a string";
}
return x.match(/10\.[0-9]{4,}\/[^\s]*[^\s\.,]/)[0];
var doi = x.match(/10\.[0-9]{4,}\/[^\s]*[^\s\.,]/);
return doi ? doi[0] : null;
},
/**