-
-
Notifications
You must be signed in to change notification settings - Fork 372
Remark mis-parses nested code blocks in list items #315
Description
When code blocks are nested within list items with CommonMark's 7-space (3+4=7) indentation rule, remark fails to recognize the code blocks and treats them as nested paragraphs in the list item rather than <code>.
Steps to reproduce
This CommonMark playground example shows how CommonMark handles nested code blocks within list items with various indentations.
TL;DR: CommonMark recognizes 7-space indents as code blocks in single-digit ordered list items.
Expected behaviour
The parsed
remarkAST should be same as the result in the CommonMark playground.
Actual behaviour
The remark parser fails to recognize CommonMark's (3+4=7) indentation for code blocks within list items and treats them as nested paragraphs in the list item rather than <code>.
This Prettier playground example shows how remark stumbles on the 7-space indentation.
(See prettier/prettier#3459 for the initial discussion and additional examples.)