Skip to content

fix: parse markdown list continuation prose#1478

Open
KirtiRamchandani wants to merge 1 commit into
google:mainfrom
KirtiRamchandani:fix/markdown-indented-content
Open

fix: parse markdown list continuation prose#1478
KirtiRamchandani wants to merge 1 commit into
google:mainfrom
KirtiRamchandani:fix/markdown-indented-content

Conversation

@KirtiRamchandani

@KirtiRamchandani KirtiRamchandani commented Jun 2, 2026

Copy link
Copy Markdown

Problem

Markdown scripts that contain two-space-indented list continuation prose can be parsed as executable code after a blank line. That matches the failure in #1388, where prose under a list item is emitted without a comment prefix. It also affects #1389, where an indented bash fence is transformed into malformed $ template-call output.

Root cause

The markdown transformer treated any line starting with two or more spaces as an indented code block after an empty line. CommonMark indented code blocks require four spaces or a tab, while fenced blocks may still be indented by up to three spaces.

Solution

Only enter indented-code mode for four or more leading spaces or a tab. The existing fenced-code parser continues to handle fences indented by up to three spaces, so indented bash fences inside list content still transform correctly.

Fixes #1388
Fixes #1389

Tests

  • node --experimental-transform-types test/md.test.ts
  • npx prettier --check src\md.ts test\md.test.ts
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError: $(...) is not a function [Bug]: cannot parse indented content

1 participant