Skip to content

fix: respect raw tokens when closing link labels - #4066

Open
evgenyponomarev wants to merge 1 commit into
markedjs:masterfrom
evgenyponomarev:codex/commonmark-link-precedence
Open

fix: respect raw tokens when closing link labels#4066
evgenyponomarev wants to merge 1 commit into
markedjs:masterfrom
evgenyponomarev:codex/commonmark-link-precedence

Conversation

@evgenyponomarev

Copy link
Copy Markdown

Marked version: master (18.0.10)

Markdown flavor: CommonMark and GitHub Flavored Markdown

Description

Addresses the independent raw-HTML/autolink precedence group in #4050 (CommonMark examples 524, 526, 536, and 538).

The inline link and reference-link regexes could treat a ] inside a still-open raw HTML tag or autolink as the end of the link label. The tokenizer now checks labels containing < and rejects that candidate close when the matching raw token extends past it. Escaped characters and code spans are skipped during the check, and ordinary labels use an early fast path.

The existing CommonMark and GFM snapshots for all four examples are now passing, increasing link compliance from 80/90 to 84/90 in both suites.

AI disclosure: OpenAI Codex assisted with repository research, implementation, and validation. I reviewed the parser behavior, corrected the spec fixtures manually, ran the complete project test pipeline, and remain responsible for the contribution.

Contributor

  • Tests exist to ensure functionality and minimize regression: CommonMark/GFM examples 524, 526, 536, and 538.
  • No documentation change is required; this brings existing supported-spec behavior into compliance.

Validation

  • npm test — passed
    • 1,783 specification tests
    • 191 unit tests
    • UMD and CommonJS tests
    • TypeScript/API compatibility checks
    • ESLint
  • npm run build:reset — generated artifacts removed before submission

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

@evgenyponomarev 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 Aug 22, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
marked-website Ready Ready Preview Aug 22, 2026 4:54pm

Request Review

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.

1 participant