Skip to content

Document side-effects of renderers' initialisation #56

@Rogdham

Description

@Rogdham

Hello, this is possibly an issue concerning the doc and not the code.

  • Parsing outside of the renderer's context manager:
d = Document('a <b> c')
with HTMLRenderer() as r:
    print(r.render(d))  # <p>a &lt;b&gt; c</p>
  • Parsing inside of the renderer's context manager:
with HTMLRenderer() as r:
    d = Document('a <b> c')
    print(r.render(d))  # <p>a <b> c</p>

Not sure where the difference in output comes from. CommonMark asks for the second output though, which seems to be what is performed in mistletoe.markdown and by the mistletoe command line.


$ python -V
Python 3.7.0
$ pip freeze
mistletoe==0.7.1

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions