vsch / flexmark-java

CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
BSD 2-Clause "Simplified" License
2.26k stars 269 forks source link

Rendering issue with <br>s and afterwards an image in markdown-format #540

Closed JohannesLichtenberger closed 1 year ago

JohannesLichtenberger commented 1 year ago

With this input text, the second image is not rendered, because the parser somehow adds it as a child to the HtmlBlock, which is wrong:

![rrrrrr](https://heise.cloudimg.io/v7/_www-heise-de_/imgs/18/3/6/4/3/6/0/7/ct_2022_22_energie4s_andreas_martini_121751_gs_online_a-4be3a70ac0c5e431.jpeg?q=85&width=2451)

<br>
![zzzzz](https://heise.cloudimg.io/v7/_www-heise-de_/imgs/18/3/6/4/8/9/0/7/offizielles-portrait-neu-0ca3b4ef2c6358b6.jpeg?q=85&width=2451)

However, it's parsed (and rendered) correctly with a line break before the image:

![rrrrrr](https://heise.cloudimg.io/v7/_www-heise-de_/imgs/18/3/6/4/3/6/0/7/ct_2022_22_energie4s_andreas_martini_121751_gs_online_a-4be3a70ac0c5e431.jpeg?q=85&width=2451)

<br>

![zzzzz](https://heise.cloudimg.io/v7/_www-heise-de_/imgs/18/3/6/4/8/9/0/7/offizielles-portrait-neu-0ca3b4ef2c6358b6.jpeg?q=85&width=2451)
JohannesLichtenberger commented 1 year ago

Seems it's the same in the commonmark reference implementation, thus I'm closing this:

https://spec.commonmark.org/dingus/