multiline footnotes incorrectly parsed
nschloe opened this issue · comments
Nico Schlömer commented
MWE:
import marko
from marko.md_renderer import MarkdownRenderer
from marko.ext.gfm import gfm
text = r"""
[^lorem]
[^lorem]: Ipsum
dolor sit amet.
"""
doc = gfm.parse(text)
for c in doc.children:
print(c)
Output:
<marko.block.BlankLine object at 0x7fd89ae2d950>
<marko.ext.gfm.elements.Paragraph object at 0x7fd89ae18110>
<marko.block.BlankLine object at 0x7fd89ae184d0>
<marko.block.LinkRefDef object at 0x7fd89aff6e50>
<marko.block.CodeBlock object at 0x7fd89ae2dc50>
(The last item shouldn't be a CodeBlock
.)
Frost Ming commented
Footnote is an opt-in and not included by gfm
by default. There are several ways to enable it:
from marko.ext.gfm import gfm
gfm.use("footnote")
# or
gfm = marko.Markdown(extensions=["gfm", "footnote"])