dylanowen / mdbook-graphviz

Mozilla Public License 2.0
42 stars 9 forks source link

Paragraph is joined to previous nested list #91

Open alek3y opened 9 months ago

alek3y commented 9 months ago

When the graphviz preprocessor is enabled, the list

- A
    - B

    C

is rendered as

instead of

alek3y commented 9 months ago

I think this might actually be an issue of pulldown-cmark-to-cmark. I'll wait confirmation before closing this.

Cypher1 commented 2 months ago

@alek3y I know it's been a while but is there any change you know if this bug still occurs?

alek3y commented 2 months ago

As far as I can tell it's still happening. I just took another look at the code, and I'm pretty sure it's pulldown_cmark_to_cmark::cmark that causes this.

The events generated by pulldown_cmark::Parser seem to be correct:

[Start(List(None))],
[Start(Item)],
[Start(Paragraph)], [Text(Borrowed("A"))], [End(Paragraph)],
[Start(List(None))], [Start(Item)], [Text(Borrowed("B"))], [End(Item)], [End(List(false))],
[Start(Paragraph)], [Text(Borrowed("C"))], [End(Paragraph)],
[End(Item)],
[End(List(false))]

However, buf is then filled with * A\n \n * B\n C which produces the wrong output I mentioned.