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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.