Percent-encode " character in DOIs when opening/copying as link
I'm not sure a double-quote actually appears in any DOIs, but it's
technically valid and would result in an invalid URL.
Follow-up to 782c2a1d1
Addresses #295
This commit is contained in:
parent
5e1beed6fd
commit
f7f55f05ad
1 changed files with 4 additions and 2 deletions
|
@ -429,10 +429,12 @@
|
|||
var doi = Zotero.Utilities.cleanDOI(val);
|
||||
if (doi) {
|
||||
doi = "https://doi.org/"
|
||||
// Encode some characters. '/' doesn't need to be encoded
|
||||
// Encode some characters that are technically valid in DOIs,
|
||||
// though generally not used. '/' doesn't need to be encoded.
|
||||
+ doi.replace(/#/g, '%23')
|
||||
.replace(/\?/g, '%3f')
|
||||
.replace(/%/g, '%25');
|
||||
.replace(/%/g, '%25')
|
||||
.replace(/"/g, '%22');
|
||||
label.classList.add("pointer");
|
||||
label.setAttribute("onclick", "ZoteroPane_Local.loadURI('" + doi + "', event)");
|
||||
label.setAttribute("tooltiptext", Zotero.getString('locate.online.tooltip'));
|
||||
|
|
Loading…
Add table
Reference in a new issue