rsc / markdown

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

Correctly render reference links in Markdown #13

Open zacharysyoung opened 5 months ago

zacharysyoung commented 5 months ago

Putting the following reference links through mdfmt, the output should equal the input:

[full][full]
[collapsed][]
[shortcut]

[collapsed]: u2
[full]: u1
[shortcut]: u3

Currently, mdfmt renders all three link styles inline... while keeping the original link reference definitions:

[full](u1)
[collapsed](u2)
[shortcut](u3)

[collapsed]: u2
[full]: u1
[shortcut]: u3