Packages icon indicating copy to clipboard operation
Packages copied to clipboard

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

Open igelstorm opened this issue 5 years ago • 0 comments

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

igelstorm avatar Feb 02 '21 13:02 igelstorm