Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically URL-decode URLs in Add Item by Identifier #3218

Open
dstillman opened this issue Jul 20, 2023 · 2 comments · May be fixed by zotero/utilities#28
Open

Automatically URL-decode URLs in Add Item by Identifier #3218

dstillman opened this issue Jul 20, 2023 · 2 comments · May be fixed by zotero/utilities#28
Assignees

Comments

@dstillman
Copy link
Member

https://forums.zotero.org/discussion/comment/439074/#Comment_439074

E.g., if https://doi.org/10.1002/1096-9128(200005)12:6%3C375::AID-CPE480%3E3.0.CO;2-M is pasted, we could automatically decode that to https://doi.org/10.1002/1096-9128(200005)12:6<375::AID-CPE480>3.0.CO;2-M before checking for a DOI.

And as I say there, maybe we could special-case %3C followed by %3E in a detected DOI and decode the whole string (even without the https://, since those are almost certainly not going to be the real DOI characters.

@dstillman
Copy link
Member Author

@dstillman
Copy link
Member Author

dstillman commented Aug 30, 2023

It looks like translation-server already decodes the URL before passing to Zotero.Utilities.cleanDOI(), but maybe we should just teach cleanDOI() to decode strings that look like URLs and also to special-case %3C and %3E for all DOIs. We'll then get this automatically for everything that uses zotero/utilities (desktop, translation-server, web-library, ZoteroBib, maybe some of iOS).

abaevbog added a commit to abaevbog/utilities that referenced this issue Sep 6, 2023
Also, attempt to drop last bracket or paren if there
is an opened one before DOI to not skip and pass existing tests.

Fixes: zotero/zotero#3218
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants