Follow-up from the second review of #92.
When emphasis wraps block content, expressEmphasisInMarkdown keeps it as a raw tag (<b>). The renderer ends the line before the nested block, but it doesn't put the opening tag alone on its line. If text comes before the block (inside the tag, or earlier in the paragraph), the <b> line doesn't start a CommonMark HTML block, so the wrapper falls apart on re-parse.
Repro (full transformHtmlToMarkdown pipeline)
<p><b>Lead:<ul><li>x</li></ul></b></p> renders <b>Lead:\n\n- x\n\n</b>. Re-parsing gives <b>Lead:</b> + list + an orphan </b>, so it is not a fixpoint.
<div>Intro <b><ul><li>x</li></ul></b></div> renders Intro <b>…. Re-parsing gives Intro <b></b> + list + an orphan </b>.
Possible fix
expressEmphasisInMarkdown already computes containsBlock, so it could mark the element block-level. The renderer would then separate the open tag onto its own line, like the spilled block-wrapping <a> (separateBeforeBlockTag() + ensureLineStart()). Location: MarkdownRendering.kt around the raw inline tag → block promotion.
Follow-up from the second review of #92.
When emphasis wraps block content,
expressEmphasisInMarkdownkeeps it as a raw tag (<b>). The renderer ends the line before the nested block, but it doesn't put the opening tag alone on its line. If text comes before the block (inside the tag, or earlier in the paragraph), the<b>line doesn't start a CommonMark HTML block, so the wrapper falls apart on re-parse.Repro (full
transformHtmlToMarkdownpipeline)<p><b>Lead:<ul><li>x</li></ul></b></p>renders<b>Lead:\n\n- x\n\n</b>. Re-parsing gives<b>Lead:</b>+ list + an orphan</b>, so it is not a fixpoint.<div>Intro <b><ul><li>x</li></ul></b></div>rendersIntro <b>…. Re-parsing givesIntro <b></b>+ list + an orphan</b>.Possible fix
expressEmphasisInMarkdownalready computescontainsBlock, so it could mark the element block-level. The renderer would then separate the open tag onto its own line, like the spilled block-wrapping<a>(separateBeforeBlockTag()+ensureLineStart()). Location:MarkdownRendering.ktaround the raw inline tag → block promotion.