Closed nschloe closed 6 months ago
@nschloe, I think you are describing 2 mistletoe problems in here:
mistletoe isn't made in a way that would support nesting renderers (or maybe just in some cases) - that is the only way I can think of how you can get the ValueError: list.remove(x): x not in list
exception from your report. E.g.:
with MarkdownRenderer() as renderer:
md = renderer.render(header)
print(md)
with MarkdownRenderer() as renderer: # fails, because we are globally removing token class for the 2nd time - which is no longer present
md = renderer.render(header)
print(md)
Heading
without parsing:
header = Heading(
[2, 'My Title', '']
)
Closing this as answered, feel free to "reopen" by commenting. I think to implement the 2 things as described in my latest comment, both would require some major refactoring and both would deserve a separate issue to discuss it thoroughly...
I'm trying to get the Markdown representation of a
Heading
I've parsed and manipulated before, butgives
I'd like to provide an MWE, but it seems that
Heading
s cannot be constructed explicitly like