@mintlify/common 1.0.682 → 1.0.684

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.
@@ -44,28 +44,31 @@ export const remarkExtractMultiView = (mdxExtracts) => {
44
44
  }
45
45
  return undefined;
46
46
  };
47
+ const seenTitles = new Set();
47
48
  visit(tree, 'mdxJsxFlowElement', (node) => {
48
49
  if (node.name === 'View') {
49
50
  const title = getStringValue(node.attributes.find((attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'title'));
51
+ if (!title || seenTitles.has(title)) {
52
+ return;
53
+ }
54
+ seenTitles.add(title);
50
55
  const icon = getStringValue(node.attributes.find((attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'icon'));
51
56
  const iconType = getStringValue(node.attributes.find((attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'iconType'));
52
57
  const content = stringifyNode({
53
58
  type: 'root',
54
59
  children: node.children,
55
60
  });
56
- if (title) {
57
- const viewItem = {
58
- title,
59
- content,
60
- };
61
- if (icon) {
62
- viewItem.icon = icon;
63
- }
64
- if (iconType) {
65
- viewItem.iconType = iconType;
66
- }
67
- multiViews.push(viewItem);
61
+ const viewItem = {
62
+ title,
63
+ content,
64
+ };
65
+ if (icon) {
66
+ viewItem.icon = icon;
67
+ }
68
+ if (iconType) {
69
+ viewItem.iconType = iconType;
68
70
  }
71
+ multiViews.push(viewItem);
69
72
  }
70
73
  });
71
74
  if (mdxExtracts && multiViews.length) {