miyuchina / mistletoe

A fast, extensible and spec-compliant Markdown parser in pure Python.
MIT License
791 stars 110 forks source link

make output markdown keep original indentation of the 1st line in a list item #196

Closed allets closed 7 months ago

allets commented 8 months ago

input markdown:

-   item 1
    -   item 1.1
-   item 2
    -   item 2.1

Markdown renderer output (v1.2.1):

- item 1
  - item 1.1
- item 2
  - item 2.1

I expect the output of Markdown renderer to be the same as the input.

My use case: I developed a tool to replace image links with local paths after downloading these images. I plan to use a parser. If it keeps the original format as much as possible, then users can easily check the necessary differences. And I found the great project, mistletoe! Thanks for your contributions to the project.