Lezer/markdown GFM task not parsing paragraphs

from the spec GitHub Flavored Markdown Spec I didn’t see any adjustment to a task item such that they should be parsed differently than normal list items besides the initial task marker.

but @lezer/markdown does parse it differently,

see playground link where for the markdown

- text
   ~~~js
   console.log("hello")
   ~~~
<!-- -->

- [X] text
   ~~~js
   console.log("hello")
   ~~~

text in the first list a paragraph is but text in the second list only part of the task is and not its own node.

see Document(BulletList(ListItem(ListMark,Paragraph,FencedCode(CodeMark,CodeInfo,CodeText,CodeMark))),CommentBlock,BulletList(ListItem(ListMark,Task(TaskMarker),FencedCode(CodeMark,CodeInfo,CodeText,CodeMark)))) as the tree.toString() output.

is there any reason to this? as this makes using the parser a bit more awkward.

Interesting difference. I wonder if it’s related to how Lezer represents task markers in its syntax tree rather than anything specific to the GFM spec. Though I agree it’s a little surprising that adding a checkbox changes the paragraph structure.

The idea is that Task takes the role of Paragraph here, as the block-wrapping node.