You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @antongolub, I'd like to work on resolving this issue.
I looked into the root cause and saw that while #1419 successfully addressed indented code fences, this case still fails on indented list prose (e.g., This assumes...).
Because tabRe = /^( +|\t)/ matches 2 or more spaces after an empty line, prose indented under a list item with 2 spaces is classified as raw JavaScript rather than Markdown prose (which should be commented out with // ).
Under CommonMark specifications (section 4.4), indented code blocks require 4 spaces or a tab, whereas 2-space indentation represents continuing list item content.
Would you prefer:
Updating tabRe to require 4 spaces or a tab (/^( {4,}|\t)/), aligning with CommonMark?
Or maintaining 2-space indentation for backwards compatibility while detecting list continuation contexts?
If option 1 is acceptable, I can submit a clean PR with regression tests in test/md.test.ts.
Activity
[-][Bug]: cannot parse intended content[/-][+][Bug]: cannot parse indented content[/+]fix(md): require 4 spaces for indented code blocks
fix(md): require 4 spaces or tab for indented code blocks (resolves g…
Anjaliavv51 commentedon Oct 21, 2026
Hi @antongolub, I'd like to work on resolving this issue.
I looked into the root cause and saw that while #1419 successfully addressed indented code fences, this case still fails on indented list prose (e.g.,
This assumes...).Because
tabRe = /^( +|\t)/matches 2 or more spaces after an empty line, prose indented under a list item with 2 spaces is classified as raw JavaScript rather than Markdown prose (which should be commented out with//).Under CommonMark specifications (section 4.4), indented code blocks require 4 spaces or a tab, whereas 2-space indentation represents continuing list item content.
Would you prefer:
tabReto require 4 spaces or a tab (/^( {4,}|\t)/), aligning with CommonMark?If option 1 is acceptable, I can submit a clean PR with regression tests in
test/md.test.ts.fix: align indented code block threshold with CommonMark (google#1388)
fix(md): require 4 spaces or tab for indented code blocks (google#1388)