@mintlify/link-rot 3.0.896 → 3.0.898
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/graph.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAbsoluteUrl, isMintIgnored } from '@mintlify/common';
|
|
1
|
+
import { cleanHeadingId, isAbsoluteUrl, isMintIgnored } from '@mintlify/common';
|
|
2
2
|
import { getFileListWithDirectories } from '@mintlify/prebuild';
|
|
3
3
|
import { existsSync } from 'fs';
|
|
4
4
|
import { parse, join, resolve, relative, dirname, basename } from 'path';
|
|
@@ -391,7 +391,7 @@ export class Graph {
|
|
|
391
391
|
brokenLinks.push(path);
|
|
392
392
|
}
|
|
393
393
|
else if ((options === null || options === void 0 ? void 0 : options.checkAnchors) && path.anchorLink) {
|
|
394
|
-
const anchor = path.anchorLink.slice(1);
|
|
394
|
+
const anchor = cleanHeadingId(path.anchorLink.slice(1));
|
|
395
395
|
const headingSlugs = this.getHeadingSlugsForPath(pathString, nodeSet);
|
|
396
396
|
if (headingSlugs && !headingSlugs.has(anchor)) {
|
|
397
397
|
brokenLinks.push(path);
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { coreRemark, isMintIgnored, remarkComponentIds, remarkExtractTableOfContents, } from '@mintlify/common';
|
|
10
|
+
import { cleanHeadingId, coreRemark, isMintIgnored, remarkComponentIds, remarkExtractTableOfContents, } from '@mintlify/common';
|
|
11
11
|
import { getMintIgnore } from '@mintlify/prebuild';
|
|
12
12
|
import fs from 'fs-extra';
|
|
13
13
|
import path from 'path';
|
|
@@ -20,7 +20,7 @@ import { getRedirects } from './getRedirects.js';
|
|
|
20
20
|
export const flattenTableOfContentsSlugs = (sections) => {
|
|
21
21
|
const slugs = new Set();
|
|
22
22
|
for (const section of sections) {
|
|
23
|
-
slugs.add(section.slug);
|
|
23
|
+
slugs.add(cleanHeadingId(section.slug));
|
|
24
24
|
for (const slug of flattenTableOfContentsSlugs(section.children)) {
|
|
25
25
|
slugs.add(slug);
|
|
26
26
|
}
|