Skip to content

fix(gate): collect README links from the prose, not from the code fences - #72

Merged
msalvatti merged 1 commit into
mainfrom
fix/link-collector-prose
Aug 3, 2026
Merged

fix(gate): collect README links from the prose, not from the code fences#72
msalvatti merged 1 commit into
mainfrom
fix/link-collector-prose

Conversation

@msalvatti

Copy link
Copy Markdown
Member

What was wrong

scripts/check-published-surface.mjs verifies that every link in the README
resolves — and it was collecting them from the whole README, code fences
included. An HTML anchor inside an example is not a link a reader can click; it is
a string the example builds at runtime:

<p><a href="${url}">Accept invitation</a></p>

The checker read that as a repository path and failed the build with
${url} does not exist in the repository.

The fix

Collection now starts from README_PROSE — the README with fenced blocks removed —
which is what the heading/anchor check in the same file already used, for the same
reason its own comment gives: a # Using pnpm inside a ```bash fence is a shell
comment, not a heading.

The snippet extractor is deliberately left reading the full README: the fences are
exactly what it compiles against dist/. Pointing it at the prose would have made it
find zero snippets and pass in silence.

Why here

Found in @bymax-one/nest-auth, where a README example tripped it
(bymaxone/nest-auth#64). This repository's README has no HTML anchor inside a code
block today, so the gate passes either way — the change is so it keeps passing for
the right reason the day one is added.

Verification

pnpm check:published passes, and still finds this README's links and snippets —
the counts it reports are unchanged apart from anything that only ever existed
inside a fence.

The published-surface gate verified every link in the README, including the ones
inside fenced code blocks. An `<a href="${url}">` in an example email template is
a string the example builds at runtime, not a link a reader can click, and the
checker tried to resolve the placeholder as a repository path — reporting
`${url} does not exist in the repository` and failing the build for a link that
does not exist.

Collection now starts from the prose, as the heading/anchor check in the same
file already did. The snippet extractor still reads the full README: the fences
are exactly what it compiles.

Found in @bymax-one/nest-auth, where a README example tripped it; applied here so
the gate does not fail this repository for the same non-reason the day its README
gains an HTML anchor inside an example.
Copilot AI review requested due to automatic review settings August 3, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the check:published gate’s README link validation to ignore fenced code blocks, so runtime placeholder strings inside examples (e.g., ${url} in HTML snippets) don’t get misinterpreted as real repository paths.

Changes:

  • Collects clickable README links from README_PROSE (README with fenced blocks removed) instead of the full README.
  • Collects internal #anchor links from README_PROSE for consistency with the existing heading/anchor extraction logic.

@msalvatti
msalvatti merged commit 33ce0d0 into main Aug 3, 2026
18 checks passed
@msalvatti
msalvatti deleted the fix/link-collector-prose branch August 3, 2026 22:44
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.

2 participants