18 Commits

Author SHA1 Message Date
Patrik Oldsberg 8f9c1d64b8 verify-links: catch broken anchors, directory links, and invisible characters (#33713)
* verify-links: catch broken anchors, directory links, and invisible characters

Enhances the link verification script to catch several categories of
broken links that were previously missed:

- Broken anchors (cross-file and same-file) by extracting heading slugs
  from target documents and verifying anchors resolve
- Directory links missing index.md suffix within docs/
- Invisible/zero-width characters in URLs
- Case-sensitive anchor mismatches

Also strips fenced code blocks before scanning for links to avoid false
positives, and handles duplicate heading slug deduplication (GitHub and
Docusaurus append -1, -2, etc.).

Fixes a few newly-caught broken links in existing docs.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

* Fix CodeQL incomplete multi-character sanitization alert

Apply HTML tag stripping in a loop so that nested fragments
like <scr<script>ipt> are fully removed.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

---------

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-04-03 17:48:40 +02:00
Fredrik Adelöw 7455dae884 require the use of node prefix on native imports
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:22:53 +01:00
Patrik Oldsberg 4e4d4cfee7 scripts/verify-links: add support for verifying links to new API reference
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-11-12 15:29:31 -05:00
Patrik Oldsberg c3623c0cb6 docs: add check and fix links spanning 3 lines
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-05-10 11:16:11 +02:00
Patrik Oldsberg 5559acab7c scripts/verify-links: add check for multi-line links
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-05-10 09:52:37 +02:00
Patrik Oldsberg ea8f7362a1 scripts/verify-links: allow all absolute URLs from changesets
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2024-02-21 20:35:15 +01:00
Patrik Oldsberg 8f3104b845 scripts/verify-links: skip api reference link validation locally
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2023-11-14 17:59:02 +01:00
Patrik Oldsberg 8f91b281c7 scripts/verify-links: verify links in changesets
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2023-10-24 13:47:16 +02:00
Patrik Oldsberg 11df6f42b9 cli: use new eslint plugin + fix issues
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2023-02-03 16:16:41 +01:00
Patrik Oldsberg 9037281eef scripts/verify-links: tweak to allow GitHub links to changelogs from docs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2022-04-19 17:32:54 +02:00
Fredrik Adelöw 923491eece run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-08-09 11:54:38 +02:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
Patrik Oldsberg e8a0506344 scripts/verify-links: refactor to not use any dependencies 2021-01-14 12:55:08 +01:00
Patrik Oldsberg 34bc80d8b2 Apply suggestions from code review 2020-12-03 15:07:37 +01:00
Patrik Oldsberg c9544afa01 scripts/verify-links: forbid relative links out of docs 2020-12-01 20:23:02 +01:00
Patrik Oldsberg 474bb5b57f rewrite other references to spotify/backstage and sorrounding things 2020-11-03 11:39:27 +01:00
Patrik Oldsberg b723cd620c scripts/verify-links: fix lint issues 2020-11-01 13:30:46 +01:00
Patrik Oldsberg ed3ff8f8e3 docs: moved verify-links to scripts 2020-11-01 13:25:38 +01:00