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

Percent-encode DOIs when prepended with https://doi.org; fixes #249 #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tupelo-schneck
Copy link

Since DOIs always contain a slash, it's unpleasant to maximally percent-encode them using encodeURIComponent. Code to minimally encode a DOI for appending to https://doi.org is

doi.replace(/[\u0000-\u0020"#%<>?[\\\]^`{|}\u007F-\u009F]/g, encodeURIComponent)

I've tried to make a pull request that does this in the necessary places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant