@astrojs/markdoc 0.15.1 → 0.15.3

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.
@@ -84,6 +84,7 @@ async function getContentEntryType({
84
84
  }
85
85
  }
86
86
  await emitOptimizedImages(ast.children, {
87
+ hasDefaultImage: Boolean(markdocConfig.nodes.image),
87
88
  astroConfig,
88
89
  pluginContext,
89
90
  filePath
@@ -236,7 +237,7 @@ function getUsedTags(markdocAst) {
236
237
  }
237
238
  async function emitOptimizedImages(nodeChildren, ctx) {
238
239
  for (const node of nodeChildren) {
239
- let isComponent = node.type === "tag" && node.tag === "image";
240
+ let isComponent = node.type === "tag" && node.tag === "image" || node.type === "image" && ctx.hasDefaultImage;
240
241
  if ((node.type === "image" || isComponent) && typeof node.attributes.src === "string") {
241
242
  let attributeName = isComponent ? "src" : "__optimizedSrc";
242
243
  if (shouldOptimizeImage(node.attributes.src)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/markdoc",
3
3
  "description": "Add support for Markdoc in your Astro site",
4
- "version": "0.15.1",
4
+ "version": "0.15.3",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -60,8 +60,8 @@
60
60
  "esbuild": "^0.25.0",
61
61
  "github-slugger": "^2.0.0",
62
62
  "htmlparser2": "^10.0.0",
63
- "@astrojs/internal-helpers": "0.6.1",
64
- "@astrojs/markdown-remark": "6.3.3",
63
+ "@astrojs/internal-helpers": "0.7.0",
64
+ "@astrojs/markdown-remark": "6.3.4",
65
65
  "@astrojs/prism": "3.3.0"
66
66
  },
67
67
  "peerDependencies": {
@@ -72,7 +72,7 @@
72
72
  "devalue": "^5.1.1",
73
73
  "linkedom": "^0.18.9",
74
74
  "vite": "^6.3.4",
75
- "astro": "5.12.0",
75
+ "astro": "5.12.7",
76
76
  "astro-scripts": "0.0.14"
77
77
  },
78
78
  "engines": {