Permalink
Browse files

Don't include } in DOI at the end if no { (#1180)

This fixes #1161.
  • Loading branch information...
zuphilip authored and adam3smith committed Nov 6, 2016
1 parent d477bc4 commit 144099adc7867e70853f83dcb2680798e5a87df6
Showing with 14 additions and 1 deletion.
  1. +14 −1 DOI.js
View
15 DOI.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2016-10-31 02:54:35"
"lastUpdated": "2016-11-05 10:57:01"
}
// The variables items and selectArray will be filled during the first
@@ -49,6 +49,9 @@ function getDOIs(doc) {
if(DOI.substr(-1) == ")" && DOI.indexOf("(") == -1) {
DOI = DOI.substr(0, DOI.length-1);
}
if(DOI.substr(-1) == "}" && DOI.indexOf("{") == -1) {
DOI = DOI.substr(0, DOI.length-1);
}
// only add new DOIs
if(dois.indexOf(DOI) == -1) {
dois.push(DOI);
@@ -178,6 +181,16 @@ var testCases = [
"type": "web",
"url": "http://www.egms.de/static/de/journals/mbi/2015-15/mbi000336.shtml",
"items": "multiple"
},
{
"type": "web",
"url": "http://www.roboticsproceedings.org/rss09/p23.html",
"items": "multiple"
},
{
"type": "web",
"url": "https://en.wikipedia.org/wiki/Template_talk:Doi",
"items": "multiple"
}
]
/** END TEST CASES **/

0 comments on commit 144099a

Please sign in to comment.