Skip to content
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

5.12 regression - namespace-ambigous elements like <a> in blocks are not rendered in SVG namespace #14723

Closed
yagebu opened this issue Dec 16, 2024 · 2 comments · Fixed by #14756
Assignees
Labels

Comments

@yagebu
Copy link

yagebu commented Dec 16, 2024

Describe the bug

The change in #14685 seems to have broken links in blocks within SVGs. Looking at that change, it now infers a "html" namespace (in the else branch) for the <a> as it's not clear from the <a> node itself which namespace it should have.

<svg>
	{#if true}
		<a href="/docs">
			<text x="20" y="40" class="small">{name}</text>
		</a>
	{/if}
</svg>

See playground links below for a reproduction.

A possible temporary workaround is to add a <g> wrapper element

Reproduction

Broken in
https://svelte.dev/playground/c498e7e6bb884b379bf1350e141c85dc
Since
https://svelte.dev/playground/c498e7e6bb884b379bf1350e141c85dc?version=5.12.0
Still worked in
https://svelte.dev/playground/c498e7e6bb884b379bf1350e141c85dc?version=5.11.3

Logs

No response

System Info

n/a, see REPL (Tested in Firefox)

Severity

blocking an upgrade

@dummdidumm
Copy link
Member

I fixed a similar bug for snippets, code from that might help fixing this one

@yagebu
Copy link
Author

yagebu commented Dec 19, 2024

Thanks for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants