@mintlify/common 1.0.670 → 1.0.671

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.
@@ -55,7 +55,7 @@ export const remarkExtractTableOfContents = (mdxExtracts, pageMetadata) => {
55
55
  }
56
56
  });
57
57
  visit(tree, (node) => {
58
- var _a, _b, _c, _d, _e;
58
+ var _a, _b, _c;
59
59
  if (excludedNodes.has(node))
60
60
  return;
61
61
  const currentTabId = tabContentMap.get(node);
@@ -145,7 +145,10 @@ export const remarkExtractTableOfContents = (mdxExtracts, pageMetadata) => {
145
145
  // Account if there is no first layer
146
146
  let arrToPushInto = contents;
147
147
  if (hasTopLayer) {
148
- arrToPushInto = (_e = (_d = contents.at(-1)) === null || _d === void 0 ? void 0 : _d.children) !== null && _e !== void 0 ? _e : [];
148
+ const lastTopLevel = contents.at(-1);
149
+ if (lastTopLevel && lastTopLevel.tabId === currentTabId) {
150
+ arrToPushInto = lastTopLevel.children;
151
+ }
149
152
  }
150
153
  arrToPushInto.push({
151
154
  title,