← Back to Pull requests

fix: allow lazy continuation after a list item with four spaces after the marker #4270

Open
itisrmk opened this pull request with 64 lines diff across 3 files
View on GitHub
itisrmk itisrmk commented on Nov 21, 2026 08:13 UTC
Author

Marked version: 18.2.1 (master at 6c2a5ab4)

Markdown flavor: CommonMark|GitHub Flavored Markdown

Description

  • No existing issue. Found by comparing marked with commonmark.js on generated inputs.
  • 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:

    -    foo
    bar
    

    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 foo and bar becomes a separate paragraph (master, commonmark; nested: master, commonmark). With three spaces after the marker it works.

    In list(), line holds 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 sees foo, treats it as indented code and ends the item. The leading spaces also stop nestedBlockMarker from seeing a nested - or > on that line.

    What changed

  • After computing the content indent of the first line, line is 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.

  • New spec test/specs/new/list_item_four_spaces_after_marker_lazy covers 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

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); 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.

  • CI is green (no forced merge required).

  • Squash and Merge PR following conventional commit guidelines.
  • Diff: 64 lines (+64 / -0) across 3 files Reviewer: UziTech Review duration: 9533m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.31) × (1 − Review Confidence (0.89)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.31 · 64 lines diff across 3 files
    0.31
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 2 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    89%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.250
    Real PR Conversation Timeline
    4 items
    vercel[bot] vercel[bot] commented on Nov 21, 2026 08:13 UTC
    Bot

    @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.

    vercel[bot] vercel[bot] commented on Nov 21, 2026 16:32 UTC
    Bot

    [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>

    UziTech UziTech approved these changes on Nov 21, 2026 16:34 UTC
    Approved Reviewer

    Thanks! 💯

    Reviewers
    Assignees
    itisrmk itisrmk
    Labels
    risk: low confidence: 89.1% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 30.9% (LOW) · Higher = larger blast radius
    30.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 89.1% · Lower = rushed or shallow review
    89.1%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 3.4% · Safe to merge
    3.4%