rsc / markdown

Basic Markdown parser and HTML generator
BSD 3-Clause "New" or "Revised" License
81 stars 4 forks source link

Allow `?`, `!`, `.`, `,`, `:,` `*`, `_`, and `~` on the interior of a link #5

Closed matloob closed 8 months ago

matloob commented 8 months ago

GFM allows ?, !, ., ,, :, *, _, and ~ on the interior of a link: https://github.github.com/gfm/#extended-autolink-path-validation

Here's a program that compares markdown and goldmark on the following input: https://go.dev/play/p/uLHnavChGYX

https://web.site:8080/~matloob

Which is rendered on github as https://web.site:8080/~matloob

The output of the program is

markdown:
<p><a href="https://web.site">https://web.site</a>:8080/~matloob</p>

goldmark:
<p><a href="https://web.site:8080/~matloob">https://web.site:8080/~matloob</a></p>
rsc commented 8 months ago

I think this bug was specifically only colon. If you find others let me know.

matloob commented 8 months ago

It's also showing up with ~. Running the program again, I get

markdown:
<p><a href="https://web.site:8080/">https://web.site:8080/</a>~matloob</p>

goldmark:
<p><a href="https://web.site:8080/~matloob">https://web.site:8080/~matloob</a></p>