Is your enhancement related to a problem? Please describe.
Introduce functionality that lets users paste raw SVG XML code into the editor. If the SVG passes Safe SVG’s sanitization process, it should render inline just like an uploaded SVG file. If it fails sanitization, show a clear error message explaining why the SVG was rejected.
This enables a faster authoring workflow, especially for users copying SVGs directly from design tools or icon libraries. It removes the extra step of needing to save and upload a file. It also benefits developers working in staging environments or prototyping designs quickly.
Designs
- Use Safe SVG’s existing sanitization pipeline to validate pasted XML before rendering.
- Provide inline error handling if the SVG is malformed or flagged as unsafe.
- Consider extending the Media Library experience to support copy-paste for SVG uploads.
- Ensure accessibility and security best practices are preserved (e.g., stripping scripts, enforcing viewBox, etc.)
Describe alternatives you've considered
Note that this comes from feedback in https://x.com/alexmansfield/status/1930381336428327344 && https://x.com/alexmansfield/status/1932200335147425954.
Code of Conduct
Is your enhancement related to a problem? Please describe.
Introduce functionality that lets users paste raw SVG XML code into the editor. If the SVG passes Safe SVG’s sanitization process, it should render inline just like an uploaded SVG file. If it fails sanitization, show a clear error message explaining why the SVG was rejected.
This enables a faster authoring workflow, especially for users copying SVGs directly from design tools or icon libraries. It removes the extra step of needing to save and upload a file. It also benefits developers working in staging environments or prototyping designs quickly.
Designs
Describe alternatives you've considered
Note that this comes from feedback in https://x.com/alexmansfield/status/1930381336428327344 && https://x.com/alexmansfield/status/1932200335147425954.
Code of Conduct