-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Astro 3.0 Markdown/MDX auto image asset imports ignore Remark plugins #8311
Comments
Hmm, I'm not exactly sure how we would check for remark / rehype plugins existing for that. Nonetheless I think a way we could make this work for MDX at least would be a way to disable the rehype part that uses the Image component and instead have a remark plugin just adding the attributes to the node using I'm not sure why it doesn't work in vanilla Markdown however, there we just add attributes to the existing |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
@epsseniyer Please refrain from trying to help people in issues with AI tools. Your messages are all incorrect and spammy. |
No. I don't use any AI tool. If you want, you can go ask an AI, 'Is this your code?' I probably won't be there because I only use Google Translate. So, I'm just writing an English text that follows grammar rules, and I handle the formatting myself. |
@epsseniyer Your comment was utterly irrelevant and unhelpful. |
Sorry then. @i-bsd |
Does this also apply to MDX? If I use custom components. E.g:
this |
No, in MDX we replace the img tags with our component using rehype. It's a known issue that user components are not respected at this time for that. In Markdown we can't do that, since well, you can't have components. So there the existing Markdoc works similarly to MDX. Many formats, many implementations, many problems, arf. |
Just ran into this problem myself – is there any plan to address this? |
I've tried using this plugin too |
Astro info
What browser are you using?
Chrome
Describe the Bug
Upgraded to Astro 3.0.
Using Remark plugin
remark-unwrap-images
to remove parent<p>
tags from images.Because of the way Astro is now automatically processing relative path images in Markdown/MDX (e.g.
![alt](./filename.jpg)
), the Remark plugin is ignored.If I use
/public/
folder images or remote images, there is no issue.Can the automatic image asset import in Markdown/MDX be fixed to check for the existence of Remark plugins?
What's the expected result?
Outputted
<img>
should not be wrapped by<p>
tags.Astro's new automatic image asset imports in Markdown should take into account Remark plugins if they exist.
Link to Minimal Reproducible Example
https://github.com/i-bsd/astro-3-img-test
Participation
The text was updated successfully, but these errors were encountered: