I was modifying an answer to make the links clickable. One of the links would have been:
- http://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm
Raw:
* http://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm
But (at least in the edit preview for the answer, and here on MSO) the URL highlighting (recognition) stops after 'Knuth'. There were analogous problems with the other URL, for the Boyer-Moore string searching algorithm.
I worked around it with:
and could have used:
Raw:
* [Knuth-Morris-Pratt algorithm](http://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm)
* [http://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm](http://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm)
but should I have needed to do either of those? Isn't a dash an OK part of a URL?
-
) are correct in URLs but en dash (–
) or em dash (—
) should be encoded to%E2%80%93
and%E2%80%94
respectively. It seems Wikipedia uses an en dash in the title there.https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
). I typed a URL with regular dashes and it was transformed to the version with en-dashes. So, it probably is Wikipedia doing the transform — it is self-coherent. The issue remains 'en-dashes are not allowed in URLs unless URL-encoded'. And what you get when you use copy'n'paste isn't 100% obvious.