Skip to content

Commit

Permalink
fix: ensure SVG element attributes have case preserved (#13935)
Browse files Browse the repository at this point in the history
* fix: ensure SVG element attributes have case preserved

* fix: ensure SVG element attributes have case preserved

* fix: ensure SVG element attributes have case preserved
  • Loading branch information
trueadm authored Oct 25, 2024
1 parent feb2d85 commit 441124c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gentle-bulldogs-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ensure SVG element attributes have case preserved
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export function SvelteElement(node, context) {
node,
element_id,
attributes_id,
b.binary('!==', b.member(element_id, 'namespaceURI'), b.id('$.NAMESPACE_SVG')),
b.binary('===', b.member(element_id, 'namespaceURI'), b.id('$.NAMESPACE_SVG')),
b.call(b.member(b.member(element_id, 'nodeName'), 'includes'), b.literal('-')),
context.state
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { test } from '../../test';

export default test({
html: `<svg viewBox="0 0 10 10"></svg><svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"></svg><svg viewBox=""></svg>`
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<svelte:options namespace="svg" />
<svelte:element this="svg" viewBox="0 0 10 10" />
<svelte:element this="svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10" />
<svg viewBox="" />

0 comments on commit 441124c

Please sign in to comment.