You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure that is the case. Even though the html output from marked and commonmark has & the browser seems to know to translate that as & and not %26 (percent encoding for &) so the links in the preview pane of both demos goes to the correct url.
The only way to see GitHub's output html is to inspect the element in dev tools, but If you inspect the links in the demos you will see that the browser has converted the & in the link to &.
So I'm guessing GitHub follows the common mark spec and the encodes it as & as well, it is just getting shown in the dev tools as &.
Yeah it's what I could see in devtools that threw me off; especially when combined with the browser still treating the links correctly. This is more of a TIL. Thanks @UziTech! Closing.
Describe the bug
&
in the query section of a URI gets escaped and re-written to&
thus breaking the link.To be very honest, I am not quite sure this is a bug since
commonmark.js dingus
produces the same result. But, for e.g., GitHub doesn't escape&
.More of a question around why and how to handle the change in semantics introduced by the escaping of
&
.To Reproduce
Steps to reproduce the behavior: (both produce the same output so this is more for ease of discovery)
Expected behavior
&
in query section of an URI should not be escaped as it changes the semantics of the query params.The text was updated successfully, but these errors were encountered: