@mintlify/common 1.0.523 → 1.0.525

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.
@@ -2,7 +2,10 @@ import { u } from 'unist-builder';
2
2
  import { visit } from 'unist-util-visit';
3
3
  export const rehypeZoomImages = () => (tree) => {
4
4
  visit(tree, 'mdxJsxFlowElement', (node, index, parent) => {
5
- if (node.name === 'img' || node.name === 'picture' || node.name === 'figure') {
5
+ if (node.name === 'img' ||
6
+ node.name === 'picture' ||
7
+ node.name === 'figure' ||
8
+ node.name === 'iframe') {
6
9
  const noZoom = node.attributes.find((attr) => attr.type === 'mdxJsxAttribute' && attr.name === 'noZoom');
7
10
  if (parent && index != null) {
8
11
  // For img elements, replace with OptimizedImage (it applies Zoom internally)
@@ -19,6 +22,9 @@ export const rehypeZoomImages = () => (tree) => {
19
22
  properties: {},
20
23
  }, [node]));
21
24
  }
25
+ if (node.name === 'iframe') {
26
+ parent.children.splice(index, 1, u('mdxJsxFlowElement', { name: 'OptimizedFrame', attributes: node.attributes }, []));
27
+ }
22
28
  }
23
29
  }
24
30
  });