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>
MWE:
Output:
(The last item shouldn't be a
CodeBlock
.)