Skip to content

Commit e1e311c

Browse files
heiskrCopilot
andauthored
Fix REST API broken anchor and skip auto-generated page anchor checks (#60169)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 267b25b commit e1e311c

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

content/rest/git/blobs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ autogenerated: rest
1515
## About Git blobs
1616

1717
A Git blob (binary large object) is the object type used to store the contents of each file in a repository. The file's SHA-1 hash is computed and stored in the blob object. These endpoints allow you to read and write [blob objects](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects)
18-
to your Git database on {% data variables.product.github %}. Blobs leverage [these custom media types](#custom-media-types-for-blobs). For more information about the use of media types in the API, see [AUTOTITLE](/rest/overview/media-types).
18+
to your Git database on {% data variables.product.github %}. Blobs leverage custom media types. For more information about the use of media types in the API, see [AUTOTITLE](/rest/overview/media-types).
1919

2020
<!-- Content after this section is automatically generated -->

src/links/scripts/check-links-internal.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ async function checkAnchorsOnPage(
101101
): Promise<BrokenLink[]> {
102102
const brokenAnchors: BrokenLink[] = []
103103

104+
// Skip anchor checking on auto-generated pages (e.g., REST, GraphQL, webhooks).
105+
// These pages have headings generated from OpenAPI/schema data at render time
106+
// by transformers that aren't run during link checking, so same-page anchor
107+
// links to those headings would always appear broken.
108+
if (page.autogenerated) {
109+
return brokenAnchors
110+
}
111+
104112
try {
105113
const html = await renderContent(page.markdown, context)
106114
const $ = load(html)

0 commit comments

Comments
 (0)