frostming / marko

A markdown parser with high extensibility.
https://marko-py.readthedocs.io/
MIT License
357 stars 38 forks source link

Incorrect markdown rendering paragraphs in list items #201

Closed quarckster closed 4 months ago

quarckster commented 4 months ago

Consider this markdown:

- first

    paragraph 1

- second

    paragraph 2

If I parse and render it with Markdown renderer the result is different:

import marko
from marko.md_renderer import MarkdownRenderer

parser = marko.Markdown(renderer=MarkdownRenderer)
parsed = parser.parse("- first\n\n    paragraph 1\n\n- second\n\n    paragraph 2\n")
print(parser.render(parsed))
- first

  paragraph 1
- second

  paragraph 2

marko version is 2.1.2

frostming commented 4 months ago

We don't guarantee the formats and indentation stability in markdown renderer. But the final result should be the same if to convert the markdown to HTML.

The above two markdown documents render to the same HTML.