Beautify
Beautify copied to clipboard
Reference-style links/footnotes broken if separated by code block
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.
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.
Thanks. I'll see if I can come up with the alternative approach on my own time.