Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/legal-facts-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes a case where the toolbar audit would incorrectly flag images processed by Astro in content collections documents
2 changes: 1 addition & 1 deletion examples/blog/src/content/blog/markdown-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions packages/astro/src/content/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ 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)}"` : ''))
.join(' ');
Expand Down