Skip to content

docs: make validate does not catch broken #anchor links #649

Closed

Description

@nc9

Found while writing pub#648. make validate in docs/ passes when an in-page or cross-page #anchor link points at a heading that no longer exists. The private app links to explicit {#id} anchors on guides/failed-audits and cloud/firewall (failure email, bell, dashboard, MCP), so a heading rename would break those links with CI green. The author verified the new anchors with a one-off script.

Acceptance Criteria

  • make validate fails when any [text](#id), [text](/path#id) or <Link href=".../path#id"> targets an anchor that does not exist on the target page
  • A test fixture with a broken anchor proves it fails, and a fixture with a valid explicit {#id} and a heading-derived id passes
  • The anchors the private app links to are listed in one file the check treats as required (failure docs anchors in failure-explanation.ts), so removing one fails CI

Activity

  1. added
    bug
    documentation
    P2
    size: S
    on Oct 11, 2026
  2. nc9 commented on Oct 11, 2026

    @nc9
    ContributorAuthor

    Checked against current main (ad95fb2): STILL TRUE, and the cause is wider than anchors.

    make validate is only bun x tangly check --strict (docs/Makefile, docs/package.json check, run by docs:check at .github/workflows/ci.yml:230). I ran tangly 0.5.0 (the pinned version) and 0.5.2 (the npm latest) against a three-page fixture. Both printed "All checks passed" for all four of these:

    • [x](/rules/perf/real#no-such-anchor): a dead anchor on a page that exists
    • [d](/rules/performance/real): a dead page
    • [r](./nope-rel): a dead relative link
    • <Card href="/nope-card">: a dead component href

    In tangly 0.5.0, dist/cli/commands/check.js only collects manifest (config and navigation) warnings and MDX parse errors. It declares a --no-links flag but never reads it, so no body link is checked at all. An anchor check therefore needs our own script, and it can share one with the dead-page check in #322.

  3. nc9 commented on Oct 16, 2026

    @nc9
    ContributorAuthor

    Fixed in #876 (bb528c3). The check computes the ids each page renders: explicit {#id} at the end of a heading, otherwise github-slugger over the rendered heading text, plus id= and <a name>. These match the live site on all 435 pages. It fails on a [text](#id), [text](/path#id) or JSX href anchor that does not exist on its target. docs/scripts/required-anchors.json lists the failed-audits and firewall anchors the cloud links to, and removing one fails CI. It found and fixed three dead anchors on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugdocumentationsize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions