@astrojs/markdoc 0.15.1 → 0.15.2
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.
|
|
4
|
+
"version": "0.15.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -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.
|
|
75
|
+
"astro": "5.12.5",
|
|
76
76
|
"astro-scripts": "0.0.14"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|