Background
As of this feature request being completed, links pasted into the Insert Hyperlink dialog that appears when you click the Hyperlink button in the editor automatically go through some kind of URL-encoding, replacing non-ascii and certain other characters with percent-encoded versions. For example, if you paste
http://en.wikipedia.org/wiki/Möbius_strip
into the hyperlink box and click OK
, the link that gets inserted into the editor is actually a link to
http://en.wikipedia.org/wiki/M%C3%B6bius_strip
This percent-encoding of characters works fine, and, as far as I know, does not break anything. However...
Bug
The Insert Hyperlink box also - destructively and, as far as I can tell, pointlessly - un-encodes certain characters in URLs, notably including the ampersand and equals signs, which many sites require to be percent-encoded when appearing as part of the data in a query string. That is, occurrences of %26
or %3D
in URLs pasted into the Insert Hyperlink box are replaced with &
and =
respectively.
Examples of this breaking, or else undesirably modifying, links:
1) This valid Google search URL:
https://www.google.co.uk/search?q=stackoverflow+q%26a
gets converted to this rather differently-behaving one if you paste it into the Insert Hyperlink box:
https://www.google.co.uk/search?q=stackoverflow%20q&a
2) This valid URL from developers.facebook.com:
gets converted to this broken one:
Proposed Solution
Never un-encode any percent-encoded characters in a URL pasted into the Hyperlink box, ever.