Skip to content

fix: keep lazy setext underlines in list items as text - #4126

Open
vhinayindia wants to merge 1 commit into
markedjs:masterfrom
vhinayindia:codex/list-lazy-setext-continuation
Open

vhinayindia wants to merge 1 commit into
markedjs:masterfrom
vhinayindia:codex/list-lazy-setext-continuation

Conversation

@vhinayindia

@vhinayindia vhinayindia commented Oct 6, 2026 •

Copy link
Copy Markdown

Marked version: 18.1.0

Markdown flavor: CommonMark

Description

CommonMark 0.31.2 §4.3 says a setext underline cannot be a lazy continuation line in a list item. For example:

- foo
===

Marked currently treats === as an underline and emits a heading. After the list tokenizer removes the item's indentation, the lazy line can incorrectly match the setext rule.

Keep an under-indented setext-looking continuation as paragraph text in this case, while preserving correctly indented setext headings. The regression fixtures cover both underline levels, zero and partial indentation, prior continuation text, and nested lists. PR #4119 addresses list tab-stop expansion; this change covers the separate setext parsing behavior.

Contributor

  • Regression tests exist to ensure functionality and minimize regression.
  • If submitting new feature, it has been documented in the appropriate places.

Verification

  • npm test passed, including docs build, spec suite, 193 unit tests, UMD/CJS, type/export checks, and ESLint.
  • A 125-case differential matrix against CommonMark.js matched with zero mismatches.

Committer

@vercel

vercel Bot commented Oct 6, 2026

Copy link
Copy Markdown

@vhinayindia is attempting to deploy a commit to the MarkedJS Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
marked-website Ready Ready Preview Oct 7, 2026 4:17am UTC

Request Review

@UziTech UziTech left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! 💯

This branch was successfully deployed

1 active deployment
Preview — 9454a774 Deployed Oct 7, 2026 by vercel[bot]
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.

2 participants