mirror of https://github.com/sveltejs/svelte
fix: correctly backport `svelte:element` to old AST (#11917)
Both `<svelte:element this="div">` and `<svelte:element this={"div"}>` were backported as `tag: "div"` for the old AST. That's wrong because the latter should result in `tag: { type: 'Literal', .. }`. Fixing this makes all the tests in prettier-plugin-svelte pass with Svelte 5. Also cleaned up a bit of code in the parser.pull/11899/head
parent
b1cbfc3d38
commit
6efd9d6f44
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: correctly backport `svelte:element` to old AST
|
@ -1,2 +1,7 @@
|
||||
<svelte:element this="div"></svelte:element>
|
||||
<!-- prettier-ignore -->
|
||||
<svelte:element this='div'></svelte:element>
|
||||
<svelte:element this={"div"}></svelte:element>
|
||||
<!-- prettier-ignore -->
|
||||
<svelte:element this={'div'}></svelte:element>
|
||||
<svelte:element this={"div"} class="foo"></svelte:element>
|
||||
|
Loading…
Reference in new issue