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

WebSearch: add a quoting = none setting to prevent quoting/escaping in URLs altogether #42

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

Conversation

igelstorm
Copy link

@igelstorm igelstorm commented Feb 2, 2021

What

  • Adds a none option for the quoting setting:
    • When this option is used, no special characters are replaced (with %xx escape codes), and the user-provided string is used exactly as written
    • When any other option is used, the behaviour should be exactly as before
  • Fixes a typo in the comments documenting the keysearch.ini file, where the quoting setting was referred to as args_quoting

Why

This is kind of a niche requirement, but I have at least one example where it's useful 😄 My use case was that I wanted to use WebSearch to look up DOIs for academic references using the doi2bib website. DOIs typically contain slashes /, and doi2bib requires these to be unescaped in the URL, so

https://doi2bib.org/bib/10.1093/qje/qjw001

works, but the escaped version

https://doi2bib.org/bib/10.1093%2Fqje%2Fqjw001

doesn't.

After this change, I can configure this site as follows in my WebSearch config, and it behaves like I want it to:

[site/doi2bib]
url = https://doi2bib.org/bib/%s
quoting = none

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

Successfully merging this pull request may close these issues.

1 participant