img
MDX component override is not used in Astro collections
#7223
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: assets
Related to the Assets feature (scope)
What version of
astro
are you using?the issue comes from
@astrojs/[email protected]+
Are you using an SSR adapter? If so, which one?
Vercel
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
When providing custom components for MDX file in content collections,
![alt](image.jpg)
will always be replaced byastro:assets
Image
component, hence not allowing to style it or customise the behaviour (for example, rendering the caption). The regression seems to come in some of@astrojs/mdx
updates, reverting to0.18
helps to mitigate the issue.In
.mdx
:p
will be correctly picked up fromcomponents
, butimg
will be ignored andastro
image used instead.Ideally,
![alt](image)
would be parsed as a local image, soprops
includesrc
,alt
,width
,height
, etc. So that they can be passed toastro:assets/Image
Link to Minimal Reproducible Example
https://codesandbox.io/p/sandbox/eager-pascal-b30gwz?file=%2Fsrc%2Fpages%2Findex.astro%3A14%2C1
Participation
The text was updated successfully, but these errors were encountered: