ITADN

Fenced code block absorbing a blank line doesn't propagate the blank to the enclosing list's tight/loose state (other absorbing leaves do)

#610Closednumist 创建于 2026-05-20
N
numistcommented
Hello! Back again with a sibling of #608. When a fenced code block (`` ``` `` or `~~~`) is open and absorbs a blank line as content, and the fence is then terminated by container collapse (rather than by an explicit closing fence), cmark leaves the enclosing list marked `tight="true"`. Input: ``` markdown - - ``` b ``` Expected: ```html <ul> <li> <ul> <li> <pre><code> </code></pre> </li> </ul> <p>b</p> </li> </ul> ``` Actual: ```html <ul> <li> <ul> <li> <pre><code> </code></pre> </li> </ul> b</li> </ul> ``` AST: ```xml <list type="bullet" tight="true"> <item> <list type="bullet" tight="true"> <item> <code_block xml:space="preserve"> </code_block> </item> </list> <paragraph> <text xml:space="preserve">b</text> </paragraph> </item> </list> ``` Among the seven multi-line block constructs that absorb blanks (indented code, fenced code, HTML types 1, 2, 3, 4, 5), only fenced code is affected. The other six already update the list's looseness signal correctly when they absorb a blank.
关闭于 2026-05-26 4 条评论