Beautify icon indicating copy to clipboard operation
Beautify copied to clipboard

Reference-style links/footnotes broken if separated by code block

Open ghost opened this issue 12 years ago • 2 comments
trafficstars

Reference-style links and footnotes will not work if there is a code block between them:

This [reference link][link1] and footnote[^fn2] will not work.
~~~
some code here
~~~
[link1]: http://example.com
[^fn2]: A footnote

Workaround is to use only inline links or place the reference definition closer to the source where possible.

However for footnotes there is no workaround as they will be rendered too early (at the end of the current text block, before the next code block) if placed anywhere except the end of the document.

ghost avatar Oct 11 '13 02:10 ghost

This is indeed an unfortunate side effect of the current approach. I think it must be possible to first wrap all code blocks in comments, do the Markdown translation and then unwrap and process the code blocks. Right now this bug will get low priority and will be fixed when I have time or somebody submits a patch.

edwinm avatar Oct 13 '13 21:10 edwinm

Thanks. I'll see if I can come up with the alternative approach on my own time.

ghost avatar Oct 14 '13 02:10 ghost