|
3 | 3 | // Renders each applicable destination version through Liquid, with caching, |
4 | 4 | // and checks the fragment against real heading IDs before the caller keeps or drops it. |
5 | 5 | // Dropping a fragment is destructive, so drop only when every applicable version lacks it. |
6 | | -// Render errors, autogenerated pages, and unknown versions stay unvalidatable to avoid false drops. |
| 6 | +// Render errors, autogenerated pages, the glossary page, and unknown versions stay unvalidatable. |
7 | 7 | import warmServer from '@/frame/lib/warm-server' |
8 | 8 | import { allVersions } from '@/versions/lib/all-versions' |
9 | 9 | import { getFeaturesByVersion } from '@/versions/middleware/features' |
10 | 10 | import { renderMarkdownLiquid } from '@/links/lib/extract-links' |
11 | 11 | import { computeHeadingIds } from '@/links/lib/heading-anchors' |
| 12 | +import { isAnchorCheckableTarget } from '@/links/lib/page-anchors' |
12 | 13 | import { createLogger } from '@/observability/logger' |
13 | 14 | import type { Context, Page } from '@/types' |
14 | 15 |
|
@@ -82,8 +83,8 @@ export class RedirectedFragmentValidator { |
82 | 83 | // Keep fragments for missing destination pages because no heading set exists. |
83 | 84 | if (!destPage) return 'unvalidatable' |
84 | 85 |
|
85 | | - // Autogenerated REST, GraphQL, and webhook pages build headings from data at render time. |
86 | | - if (destPage.autogenerated) return 'unvalidatable' |
| 86 | + // Autogenerated pages and the glossaries loop page build headings from data this render lacks. |
| 87 | + if (!isAnchorCheckableTarget(destPage)) return 'unvalidatable' |
87 | 88 |
|
88 | 89 | const anchor = fragment.replace(/^#/, '') |
89 | 90 | if (!anchor) return 'keep' |
|
0 commit comments