Skip to content

broken-links --check-anchors misses invalid colon anchors #5537

@JuroUhlar

Description

@JuroUhlar

Summary

mint broken-links --check-anchors does not report anchor links whose fragments contain punctuation that is not present in the generated page heading id. In particular, links with : in the fragment pass the CLI check even though they do not scroll to the target heading on the rendered/deployed docs page.

Reproduction

Given a heading like:

## Step 1: Issue a proxy secret

Mintlify renders the heading anchor as:

#step-1-issue-a-proxy-secret

But this invalid link is accepted by mint broken-links --check-anchors:

[Step 1](/docs/cloudfront-proxy-integration-v2#step-1:-issue-a-proxy-secret)

Expected valid link:

[Step 1](/docs/cloudfront-proxy-integration-v2#step-1-issue-a-proxy-secret)

Expected Behavior

mint broken-links --check-anchors should fail for #step-1:-issue-a-proxy-secret because no rendered heading id with that exact fragment exists.

Actual Behavior

The command succeeds and does not report the invalid anchor. On the deployed page, the link navigates to the page but does not scroll to the heading.

Version Tested

I reproduced this with:

  • mint 4.2.426
  • mint 4.2.531

Notes

This looks like the anchor validator may normalize punctuation too loosely when comparing link fragments to generated heading slugs. The browser uses the actual rendered id, so #step-1:-issue-a-proxy-secret and #step-1-issue-a-proxy-secret are not equivalent at runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions