Steps to reproduce
- Click the Cite button in VisualEditor
- Paste in https://zhaofeng.li/sandbox/ .html. The reference will be generated correctly.
- Paste in https://zhaofeng.li/sandbox/%20.html. It will fail to generate a citation.
Why?
Because the URL is automatically (re-)encoded in ve.ui.CiteFromIdInspector.js before the request is sent, changing "%20" to "%2520". In order to prevent double-encoding, the script should decode the URL first.