www

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

commit e935001586dffafc35e2db76d89fee52d6c879bd
parent 01c71fd970c297c417d16741e26b5966efefdab9
Author: bwiernik <bwiernik@users.noreply.github.com>
Date:   Tue,  7 Nov 2017 22:48:12 +0100

Support short DOIs in cleanDOI() and update DOI copyAsURL prefix (#1356)


Diffstat:
Mchrome/content/zotero/bindings/itembox.xml | 2+-
Mchrome/content/zotero/xpcom/utilities.js | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml @@ -427,7 +427,7 @@ // Pull out DOI, in case there's a prefix var doi = Zotero.Utilities.cleanDOI(val); if (doi) { - doi = "http://dx.doi.org/" + encodeURIComponent(doi); + doi = "https://doi.org/" + encodeURIComponent(doi); label.classList.add("pointer"); label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)"); label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip')); diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js @@ -311,7 +311,7 @@ Zotero.Utilities = { 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; },