fix: allow lazy continuation after a list item with four spaces after the marker #4270
@devin-ai-integration[bot] is attempting to deploy a commit to the MarkedJS Team on Vercel.
A member of the Team first needs to authorize it.
[vc]: #HXkSiysTwqo6Ydnq1dNy/DyX6OvZnaeojlcmp90ClB4=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJtYXJrZWQtd2Vic2l0ZSIsInByb2plY3RJZCI6InByal9RbnhOam0wSDI0YlVHQWI1MWIxUnVaa25ReXlZIiwidjAiOmZhbHNlLCJyb290RGlyZWN0b3J5IjpudWxsLCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vbWFya2VkanMvbWFya2VkLXdlYnNpdGUvNW9DblA4elg4R3V3VHdYb0xMRkRMZ0NmVm01SiIsInByZXZpZXdVcmwiOiJtYXJrZWQtd2Vic2l0ZS1naXQtZm9yay1pdGlzcm1rLWZpeC1saXN0LWZvdXItcy0zMTRhMDAtbWFya2VkanMudmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJtYXJrZWQtd2Vic2l0ZS1naXQtZm9yay1pdGlzcm1rLWZpeC1saXN0LWZvdXItcy0zMTRhMDAtbWFya2VkanMudmVyY2VsLmFwcCJ9fV0sInJlcXVlc3RSZXZpZXdVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vdmVyY2VsLWFnZW50L3JlcXVlc3QtcmV2aWV3P293bmVyPW1hcmtlZGpzJnJlcG89bWFya2VkJnByPTQyNzAifQ==
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated |
| :--- | :----- | :------ | :------ |
| <a href="https://vercel.com/markedjs/marked-website"><sup><img src="https://vercel.com/api/www/avatar?projectId=prj_QnxNjm0H24bUGAb51b1RuZknQyyY&teamId=team_RpARALaqy6bNW7b6MI363ieY&s=32" width="16" height="16" align="middle" alt="" /></sup></a> marked-website | !Ready Ready | Preview | <relative-time datetime="2026-11-21T16:32:42.854Z">Nov 21, 2026 4:32pm UTC</relative-time> |
<a href="https://vercel.com/vercel-agent/request-review?owner=markedjs&repo=marked&pr=4270" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
Thanks! 💯
UziTech
itisrmk
Marked version: 18.2.1 (master at 6c2a5ab4)
Markdown flavor: CommonMark|GitHub Flavored Markdown
Description
Expectation
CommonMark §5.2: a list item marker can be followed by 1–4 spaces, and the content starts after them. With exactly four spaces the first line is still a paragraph (only five or more spaces start indented code), so a lazy continuation line belongs to it:
should render
<li>foo\nbar</li>. The same goes for ordered items (1. foo) and for a nested list or block quote on the first line (- - foo).Result
The list ends after
fooandbarbecomes a separate paragraph (master, commonmark; nested: master, commonmark). With three spaces after the marker it works.In
list(),lineholds the previous line relative to the item content for every line except the first, where it still includes the spaces after the marker. With four spaces, the lazy-continuation check seesfoo, treats it as indented code and ends the item. The leading spaces also stopnestedBlockMarkerfrom seeing a nested-or>on that line.What changed
lineis set to the item content (itemContents), so the first line is checked the same way as later lines. Five or more spaces still give indented code (line.slice(1)keeps the code indentation), so lazy lines still don't continue it.test/specs/new/list_item_four_spaces_after_marker_lazycovers bullet and ordered items, a nested list and a block quote on the first line, and a heading and indented code that a lazy line must not continue. The expected output matches commonmark.js.Contributor
Committer
In most cases, this should be a different person than the contributor.