russross / blackfriday

Blackfriday: a markdown processor for Go
Other
5.44k stars 599 forks source link

Links: missing information in the AST #546

Open MichaelMure opened 5 years ago

MichaelMure commented 5 years ago

Considering this example:

This page offers a brief overview of what it's like to use Markdown.
The [syntax page] [s] provides complete, detailed documentation for
every feature, but Markdown should be very easy to pick up simply by
looking at a few examples of it in action. 

  [s]: /projects/markdown/syntax  "Markdown Syntax"
  [d]: /projects/markdown/dingus  "Markdown Dingus"
  [src]: /projects/markdown/basics.text

As far as I can tell, there is no way from the AST to:

  1. know what ref label was used (s, d and src)
  2. know where the list of links is, to render it

Additionally, it seems that node.LinkData.NoteID is never set ? Am I missing someting ?

For some context, I'm writing a terminal renderer, and as the screen space is limited, I want to encourage the ref style links, and actually render them like this.