mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-10 21:40:00 +00:00
RoundtripRenderer looses list content #745
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stylefish on GitHub (Jun 13, 2025).
hi,
i've an issue when using the
RoundtripRenderer. When this document gets parsed and rendered back to md (doing this for cleanup), the first list element is missing:here is some sample code:
md and md2 should be equal, but md2 is missing the
1.after the first dash-.so this:
is after the rpundtrip this:
according to commonmark reference implementation this should work: https://spec.commonmark.org/dingus/
is this a bug or is there a way to workaround this? i'm a little stuck here.
any help would be much appreciated! thank you!
greetings
@MihaZupan commented on GitHub (Jun 13, 2025):
Probably a bug in the roundtrip renderer for ordered lists.
Compare the ordered part
682c727288/src/Markdig/Renderers/Roundtrip/ListRenderer.cs (L30-L32)vs unordered
682c727288/src/Markdig/Renderers/Roundtrip/ListRenderer.cs (L47-L58)The former is probably missing the handling for 0 blocks & the pop indent.
@stylefish commented on GitHub (Jun 13, 2025):
great - thanks for pointing that out - i'll have a look next week and try to create a PR