From 9b1f35852b9399900645d95d1ac0083e871988e5 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 20 Jun 2025 11:01:48 +0200 Subject: [PATCH 1/3] fix: toolbar md file audit --- .changeset/legal-facts-teach.md | 5 +++++ examples/blog/src/content/blog/markdown-style-guide.md | 2 +- packages/astro/src/content/runtime.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/legal-facts-teach.md diff --git a/.changeset/legal-facts-teach.md b/.changeset/legal-facts-teach.md new file mode 100644 index 000000000000..5e4a0e68006c --- /dev/null +++ b/.changeset/legal-facts-teach.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fixes a case where the toolbar audit would incorrectl flag images processed by Astro in content collections documents diff --git a/examples/blog/src/content/blog/markdown-style-guide.md b/examples/blog/src/content/blog/markdown-style-guide.md index 1c010bea8109..b7a4c9ea13fb 100644 --- a/examples/blog/src/content/blog/markdown-style-guide.md +++ b/examples/blog/src/content/blog/markdown-style-guide.md @@ -39,7 +39,7 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap ### Output -![blog placeholder](/blog-placeholder-about.jpg) +![blog placeholder](../../assets/blog-placeholder-about.jpg) ## Blockquotes diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts index f669f17fe3c2..e6355689b573 100644 --- a/packages/astro/src/content/runtime.ts +++ b/packages/astro/src/content/runtime.ts @@ -700,6 +700,7 @@ async function updateImageReferencesInBody(html: string, fileName: string) { ...attributes, src: image.src, srcset: image.srcSet.attribute, + ...(import.meta.env.DEV ? { 'data-image-component': 'true' } : {}), }) .map(([key, value]) => (value ? `${key}="${escape(value)}"` : '')) .join(' '); From 12269ec25bd44226fd038770b3e3cfd6e6ce3c95 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 20 Jun 2025 11:03:30 +0200 Subject: [PATCH 2/3] Update legal-facts-teach.md --- .changeset/legal-facts-teach.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/legal-facts-teach.md b/.changeset/legal-facts-teach.md index 5e4a0e68006c..5fe2dff41818 100644 --- a/.changeset/legal-facts-teach.md +++ b/.changeset/legal-facts-teach.md @@ -2,4 +2,4 @@ 'astro': patch --- -Fixes a case where the toolbar audit would incorrectl flag images processed by Astro in content collections documents +Fixes a case where the toolbar audit would incorrectly flag images processed by Astro in content collections documents From 7551b06408c0dd6ec7db9d0f6e29d99edb1eaa0a Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Fri, 20 Jun 2025 13:08:12 +0200 Subject: [PATCH 3/3] Update packages/astro/src/content/runtime.ts --- packages/astro/src/content/runtime.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/astro/src/content/runtime.ts b/packages/astro/src/content/runtime.ts index e6355689b573..0e3607d3a2c6 100644 --- a/packages/astro/src/content/runtime.ts +++ b/packages/astro/src/content/runtime.ts @@ -700,6 +700,7 @@ async function updateImageReferencesInBody(html: string, fileName: string) { ...attributes, src: image.src, srcset: image.srcSet.attribute, + // This attribute is used by the toolbar audit ...(import.meta.env.DEV ? { 'data-image-component': 'true' } : {}), }) .map(([key, value]) => (value ? `${key}="${escape(value)}"` : ''))