mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Successive Footnotes fail parsing #31
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Jither on GitHub (Jun 23, 2016).
Well, "fail" is relative here - since footnote syntax doesn't have any exact specification.
However, I'd expect this test to succeed:
To be more specific, when using
ToHtml(), Footnote 1 and 3 are rendered as footnotes, while 2 and 4 are rendered as paragraphs.The reason seems to be that when entering
FootnoteParser.TryOpenon the second footnote, this will cause a return:... due to
CurrentContainerstill being the previous footnote. I'm not confident enough with the parser to see where the correct place would be for popping back out to the document container.From some other parsers, it seems it's even feasible to break out without an empty line (according to babelmark: php-markdown-extra, pandoc, multimarkdown, kramdown, minima, maruku; and in Javascript e.g. remarkable/markdown-it). I.e. this would render the same:
... and that always seemed ideal to me for most uses of footnotes - but it's always rather complex to tell in Markdown syntax, what conflicts this might cause with other parsers.
@xoofx commented on GitHub (Jun 23, 2016):
Thanks for the report! Indeed, I will have to put a little bit more tests for footnotes...
This is fixed by commit
c8a28a1@xoofx commented on GitHub (Jun 23, 2016):
Woops, I completely forgot the last case. Sorry, this is not fixed completely 😅
@xoofx commented on GitHub (Jun 23, 2016):
Tight footnotes case should be fixed by latest commit
266e0c8@Jither commented on GitHub (Jun 23, 2016):
That was amazingly fast! 😮 👍