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

Svelte 5 removes href of use tag in SVG, breaking sprites #14356

Closed
Razunter opened this issue Nov 19, 2024 · 1 comment · Fixed by #14359
Closed

Svelte 5 removes href of use tag in SVG, breaking sprites #14356

Razunter opened this issue Nov 19, 2024 · 1 comment · Fixed by #14359
Assignees
Labels

Comments

@Razunter
Copy link

Describe the bug

Svelte 5.2.0+ removes xlink:href and href in <use> tag of SVG when it includes imported variable. There are probably other cases than just this svg issue.

Example:

<script>
	import { sprites } from './_generatedVariables.js'
	
	let name = 'world';
</script>

<h1>Hello {name}!
<svg width="13" height="14" aria-hidden="true">
    <use xlink:href="{sprites['svgsprite2']}#done"></use>
  </svg>
</h1>

Svelte generates component without xlink:href.

Reproduction

https://svelte.dev/playground/70b9436a1d01428da9d1561a272e60c9?version=5.2.3

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700KF
    Memory: 23.36 GB / 31.27 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.volta/tools/image/node/22.11.0/bin/node
    npm: 10.9.0 - ~/.volta/tools/image/node/22.11.0/bin/npm
    pnpm: 9.12.2 - ~/.volta/bin/pnpm
    bun: 1.1.34 - ~/.bun/bin/bun
  npmPackages:
    rollup: ^4.27.3 => 4.27.3
    svelte: 5.2.3 => 5.2.3

Severity

blocking an upgrade

@Razunter
Copy link
Author

probably related to #14269

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.

2 participants