Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use snippet as parent element of snippets childrens in validator (…
…#11463) * fix: use snippet as parent element of snippets childrens in validator * Update packages/svelte/src/compiler/phases/2-analyze/validation.js * Update .changeset/wet-pears-remain.md --------- Co-authored-by: Rich Harris <hello@rich-harris.dev>
- Loading branch information
1 parent
4fb4365
commit 70419da
Showing
4 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"svelte": patch | ||
--- | ||
|
||
fix: skip parent element validation for snippet contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/svelte/tests/validator/samples/non-invalid-node-placement-if-snippet/errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
10 changes: 10 additions & 0 deletions
10
packages/svelte/tests/validator/samples/non-invalid-node-placement-if-snippet/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<table> | ||
<tbody> | ||
<tr> | ||
{#snippet cell(v)}Value: {v}{/snippet} | ||
{#each [1, 2, 3] as v} | ||
<td>{@render cell(v)}</td> | ||
{/each} | ||
</tr> | ||
</tbody> | ||
</table> |