@astrojs/mdx 4.0.3 → 4.0.5

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.
@@ -51,11 +51,12 @@ function getImageComponentAttributes(props) {
51
51
  }
52
52
  function rehypeImageToComponent() {
53
53
  return function(tree, file) {
54
- if (!file.data.astro?.imagePaths) return;
54
+ if (!file.data.astro?.imagePaths?.length) return;
55
55
  const importsStatements = [];
56
56
  const importedImages = /* @__PURE__ */ new Map();
57
57
  visit(tree, "element", (node, index, parent) => {
58
- if (!file.data.astro?.imagePaths || node.tagName !== "img" || !node.properties.src) return;
58
+ if (!file.data.astro?.imagePaths?.length || node.tagName !== "img" || !node.properties.src)
59
+ return;
59
60
  const src = decodeURI(String(node.properties.src));
60
61
  if (!file.data.astro.imagePaths?.includes(src)) return;
61
62
  let importName = importedImages.get(src);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/mdx",
3
3
  "description": "Add support for MDX pages in your Astro site",
4
- "version": "4.0.3",
4
+ "version": "4.0.5",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -63,7 +63,7 @@
63
63
  "shiki": "^1.23.1",
64
64
  "unified": "^11.0.5",
65
65
  "vite": "^6.0.5",
66
- "astro": "5.1.1",
66
+ "astro": "5.1.5",
67
67
  "astro-scripts": "0.0.14"
68
68
  },
69
69
  "engines": {