Support short DOIs in cleanDOI() and update DOI copyAsURL prefix (#1356)
This commit is contained in:
parent
01c71fd970
commit
e935001586
|
@ -427,7 +427,7 @@
|
||||||
// Pull out DOI, in case there's a prefix
|
// Pull out DOI, in case there's a prefix
|
||||||
var doi = Zotero.Utilities.cleanDOI(val);
|
var doi = Zotero.Utilities.cleanDOI(val);
|
||||||
if (doi) {
|
if (doi) {
|
||||||
doi = "http://dx.doi.org/" + encodeURIComponent(doi);
|
doi = "https://doi.org/" + encodeURIComponent(doi);
|
||||||
label.classList.add("pointer");
|
label.classList.add("pointer");
|
||||||
label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)");
|
label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)");
|
||||||
label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip'));
|
label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip'));
|
||||||
|
|
|
@ -311,7 +311,7 @@ Zotero.Utilities = {
|
||||||
throw "cleanDOI: argument must be a string";
|
throw "cleanDOI: argument must be a string";
|
||||||
}
|
}
|
||||||
|
|
||||||
var doi = x.match(/10\.[0-9]{4,}\/[^\s]*[^\s\.,]/);
|
var doi = x.match(/10(?:\.[0-9]{4,})?\/[^\s]*[^\s\.,]/);
|
||||||
return doi ? doi[0] : null;
|
return doi ? doi[0] : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user