DEV Community

Discussion on: What was your win this week?

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I figured out that having {@html generate_some_svg_code()} at the top level of a svelte component generates a bunch of SVG tags with the XHTML namespace so they don't show up, but wrapping it in a <g> tag like this <g>{@html generate_some_svg_code()}</g> seems to change something about how svelte handles the SVG-String so it gets inserted with the proper namespace.

I spent something like 3 hours trying to find a workaround and just stumbled upon this weird quirk by chance.