Text(markdown:) currently treats rendered Markdown as either a single paragraph or multiple adjacent paragraphs and then does HTML string surgery on the result.
That breaks for block Markdown that mixes headings, paragraphs, and lists:
- the first heading is always parsed with
removeTitleFromBody: true, so a heading can disappear from the rendered body
- block content can be rewrapped into invalid paragraph structure
- after HTML prettification this can show up as empty
<p></p> elements that adversely affect layout
Minimal example:
Text(markdown: """
## Heading 1
Text 1
Text 2
## Heading 2
Text 3
""")
Expected:
- both headings are preserved
- paragraphs remain valid
- block Markdown renders as valid block HTML
Actual:
- headings can disappear
- invalid paragraph HTML can be produced
- prettification can normalize the broken structure into empty paragraphs
Text(markdown:)currently treats rendered Markdown as either a single paragraph or multiple adjacent paragraphs and then does HTML string surgery on the result.That breaks for block Markdown that mixes headings, paragraphs, and lists:
removeTitleFromBody: true, so a heading can disappear from the rendered body<p></p>elements that adversely affect layoutMinimal example: