Example 479 - URL in href escape is unexpected

Example 479

<http://foo.bar.baz?q=hello&id=22&boolean>

to 

<p><a href="http://foo.bar.baz?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz?q=hello&amp;id=22&amp;boolean</a></p>

href link is encoded. That is really bad practice! The user definitely want to go the same link with input but not the one with &amp;

I wonder why it the < and > aren’t rendered to the html entities and the url isn’t just autolinked.

See Do I encode ampersands in <a href…>? on Stackoverflow on this exact topic. TL;DR - the example is correct.

Because < and > are the markers that identify an “autolink”. In CommonMark autolinks are not as “auto” as some other parsers (that would recognize links without any special symbols) and must be surrounded by <>.

1 Like
  1. As @Knagis said, THIS example is correct. Use dingus to check.
  2. Here are links for more general discussion of normalization process & implementation bugs:

There are things to fix, but your example is not from those.