Skip to content

fix: allow zero-padded ordered lists starting at 1 to interrupt paragraphs - #4291

Open
saudademjj wants to merge 2 commits into
markedjs:masterfrom
saudademjj:fix/zero-padded-ordered-list-interrupt
Open

saudademjj wants to merge 2 commits into
markedjs:masterfrom
saudademjj:fix/zero-padded-ordered-list-interrupt

Conversation

@saudademjj

Copy link
Copy Markdown

Marked version: 18.2.0 - 18.3.0

Markdown flavor: CommonMark|GitHub Flavored Markdown

Description

other.listInterruptsParagraph, blockNormal.paragraph, blockGfm.paragraph, and gfmTable matched literal 1[.)] instead of any 1–9 digit ordered-list marker with start number 1 (0{0,8}1[.)]). As a result, zero-padded ordered lists like 01. b failed to interrupt paragraphs (including nested lists inside a list item since 18.2.0) and GFM tables.

This updates the paragraph/table list-interruption pattern from 1[.)] to 0{0,8}1[.)] (keeping 00., 02., 10-digit 0000000001., and empty 01. non-interrupting per CommonMark §5.2/§5.3) and reuses other.listInterruptsParagraph in paragraph and blockGfm.paragraph. Verified all 4 modified regexes remain safe with test/recheck.ts.

Demo links (- a\n 01. b\n 02. c, {"gfm":true}):

Contributor

  • Test(s) exist to ensure functionality and minimize regression (added test/specs/new/zero_padded_ordered_list_interrupt.{md,html} and test/specs/new/zero_padded_ordered_list_interrupt_nogfm.{md,html}); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@saudademjj 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 Nov 28, 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 Nov 28, 2026 8:28am 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.

Thanks! 💯

This branch was successfully deployed

1 active deployment
Preview — 35520af2 Deployed Nov 28, 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.

Zero-padded ordered list under a list item is no longer a list (regression in 18.2.0)

2 participants