Skip to content

Allow SVGs when using Assets#7643

Merged
Princesseuh merged 5 commits intowithastro:mainfrom
alvinometric:main
Jul 13, 2023
Merged

Allow SVGs when using Assets#7643
Princesseuh merged 5 commits intowithastro:mainfrom
alvinometric:main

Conversation

@alvinometric
Copy link
Copy Markdown
Contributor

Changes

Hello Astro team,
This an attempt to fix #7420. It now allows SVG using assets (previously it would throw an error if you used an svg in a markdown image tag, you can refer to the original issue) by not passing them to the transformer.

This would have been impossible without @Princesseuh's help, thank you so much Erika 🙏

Testing

Locally using a test project.

Docs

I updated the wording in the error message, to make it clear that not everything gets optimised. That's the part of the PR that I'm most unsure of, so any comments appreciated!

@alvinometric alvinometric requested a review from a team as a code owner July 13, 2023 17:25
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 13, 2023

🦋 Changeset detected

Latest commit: 7b981dd

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jul 13, 2023
Copy link
Copy Markdown
Member

@Princesseuh Princesseuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, thank you very much!

@Princesseuh Princesseuh merged commit 4b82e55 into withastro:main Jul 13, 2023
@astrobot-houston astrobot-houston mentioned this pull request Jul 13, 2023
borgoat added a commit to borgoat/astro that referenced this pull request Jan 25, 2025
The Sharp service would deliberately prevent SVG images from being processed(withastro#7643).
However, Sharp does support transforming SVG.
Therefore, we forward the transform configuration to Sharp as-is
borgoat added a commit to borgoat/astro that referenced this pull request Jan 25, 2025
The Sharp service would deliberately prevent SVG images from being processed(withastro#7643).
However, Sharp does support transforming SVG.
Therefore, we forward the transform configuration to Sharp as-is
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Impossible to use SVG files in Markdown when astro:assets is enabled

2 participants