Skip to content

Commit

Permalink
Don't include } in DOI at the end if no { (#1180)
Browse files Browse the repository at this point in the history
This fixes #1161.
  • Loading branch information
zuphilip authored and adam3smith committed Nov 6, 2016
1 parent d477bc4 commit 144099a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion DOI.js
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.