yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

some autolinks not parsed correctly #434

Closed matloob closed 11 months ago

matloob commented 11 months ago

goldmark has https://github.com/yuin/goldmark/discussions in github. You should post only issues here. Feature requests and questions should be posted at discussions.

Please answer the following before submitting your issue:

  1. What version of goldmark are you using? : 1.6.0

  2. What version of Go are you using? : 1.21.4

  3. What operating system and processor architecture are you using? : darwin/amd64

  4. What did you do? : I ran the following program: https://go.dev/play/p/HQkNuzgNdrt

  5. What did you expect to see? :

    goldmark:
    <h2>heading</h2>
    <h4>subheading</h4>
    <p>中文:<a href="https://web.site">https://web.site</a></p>
  6. What did you see instead? :

    goldmark:
    <h2>heading</h2>
    <h4>subheading</h4>
    <p>中文:https://web.site</p>
  7. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?:

yes see below

heading

subheading

中文:https://web.site

yuin commented 11 months ago

Works as expected. For CommonMark parsers, An official spec is more important than implementations.

Official Github flavored markdown spec defines AutoLink as follows:

All such recognized autolinks can only come at the beginning of a line, after whitespace, or any of the delimiting characters *, _, ~, and (.

https://github.github.com/gfm/#autolinks-extension-