Skip to content

Docs link checker: keep heading anchors unique - #7769

Open
Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/docs-link-slug-collision
Open

Barbital11111 wants to merge 1 commit into
ItsNotRexed:mainfrom
Barbital11111:fix/docs-link-slug-collision

Conversation

@Barbital11111

Copy link
Copy Markdown
Contributor

DOCS-LINK-SLUG-COLLISION (claim)

GitHub allocates a unique identifier when a heading would reuse an earlier anchor. A literal heading such as Guide-1 can reserve the same identifier as a generated suffix for Guide. The checker now skips occupied identifiers and retains the next suffix for each base.

The regression covers literal suffixes before and after duplicate headings. Both subcases failed against the old checker.

Verification

AI-assisted (Codex). CPU-only tests using synthetic Markdown.

@azterixx

Copy link
Copy Markdown

checked: #7769 | with: python -I -m unittest discover -s tests -p test_docs_links.py | on: Debian 13, Intel i7-8700, CPython 3.13.5, head c217bad, CPU only | result: the new test passes and the dev-tools.md anchor is fixed; test_every_relative_link_resolves still fails on one pre-existing link, also broken on main@dde82f27e: docs/gpu_test_results.md -> gpu-test-results/RX9070GRE.txt (missing file)

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