Skip to content

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

Merged
UziTech merged 1 commit into
markedjs:masterfrom
evgenyponomarev:codex/commonmark-link-precedence
Sep 12, 2026
Merged

UziTech merged 1 commit into
markedjs:masterfrom
evgenyponomarev:codex/commonmark-link-precedence

Conversation

@evgenyponomarev

Copy link
Copy Markdown
Contributor

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

@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! 💯

@UziTech
UziTech merged commit ef394f7 into markedjs:master Sep 12, 2026
8 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 12, 2026
## [18.0.13](v18.0.12...v18.0.13) (2026-09-12)

### Bug Fixes

* allow tabs in the thematic break that ends a list item ([#4087](#4087)) ([afbb27c](afbb27c))
* avoid O(n^2) scanning in reflinkSearch ([#4090](#4090)) ([c6a25bb](c6a25bb))
* case fold reference link labels ([#4077](#4077)) ([aed9336](aed9336))
* drop the leading whitespace after a hard line break ([#4075](#4075)) ([123ce04](123ce04))
* match html block start conditions when ending a list item ([#4072](#4072)) ([c2facac](c2facac))
* respect raw tokens when closing link labels ([#4066](#4066)) ([ef394f7](ef394f7))
* strip a tab that follows spaces in an indented code block ([#4080](#4080)) ([dbb393d](dbb393d))

This branch was successfully deployed

1 active deployment
Preview — 3efaed9b Deployed Aug 22, 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.

3 participants