@mintlify/link-rot 3.0.907 → 3.0.909

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.
@@ -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 { cleanHeadingId, coreRemark, generateParamFieldId, isMintIgnored, remarkComponentIds, remarkExtractTableOfContents, } from '@mintlify/common';
10
+ import { cleanHeadingId, COMPONENTS_WITH_CLEANED_ID, COMPONENTS_WITHOUT_ID, coreRemark, generateParamFieldId, 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';
@@ -33,14 +33,7 @@ export const extractComponentAnchorIds = (tree) => {
33
33
  const ids = new Set();
34
34
  const paramCounts = new Map();
35
35
  visit(tree, 'mdxJsxFlowElement', (node) => {
36
- var _a, _b;
37
- if (node.name === 'Heading') {
38
- const idAttr = node.attributes.find((attr) => 'name' in attr && attr.name === 'id');
39
- if (idAttr && typeof idAttr.value === 'string') {
40
- ids.add(cleanHeadingId(idAttr.value));
41
- }
42
- return;
43
- }
36
+ var _a, _b, _c, _d;
44
37
  if (PARAM_FIELD_NAMES.has((_a = node.name) !== null && _a !== void 0 ? _a : '')) {
45
38
  const nameAttr = node.attributes.find((attr) => 'name' in attr && PARAM_FIELD_ATTR_NAMES.has(attr.name));
46
39
  if (nameAttr && typeof nameAttr.value === 'string' && nameAttr.value) {
@@ -50,11 +43,15 @@ export const extractComponentAnchorIds = (tree) => {
50
43
  }
51
44
  return;
52
45
  }
53
- if (node.name === 'Accordion') {
54
- const idAttr = node.attributes.find((attr) => 'name' in attr && attr.name === 'id');
55
- if (idAttr && typeof idAttr.value === 'string' && idAttr.value) {
56
- ids.add(idAttr.value);
57
- }
46
+ if (COMPONENTS_WITHOUT_ID.has((_c = node.name) !== null && _c !== void 0 ? _c : '')) {
47
+ return;
48
+ }
49
+ const idAttr = node.attributes.find((attr) => 'name' in attr && attr.name === 'id');
50
+ if (idAttr && typeof idAttr.value === 'string' && idAttr.value) {
51
+ const id = COMPONENTS_WITH_CLEANED_ID.has((_d = node.name) !== null && _d !== void 0 ? _d : '')
52
+ ? cleanHeadingId(idAttr.value)
53
+ : idAttr.value;
54
+ ids.add(id);
58
55
  }
59
56
  });
60
57
  return ids;