feat: allow every children in `template` tags (#15007)

* feat: allow every children in `template` tags

* Update .changeset/dry-mails-return.md

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/15013/head
Paolo Ricciuti 8 months ago committed by GitHub
parent a1698c63ec
commit dfa97a5e64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': minor
---
feat: allow `<template>` elements to contain any child

@ -186,6 +186,8 @@ export function is_tag_valid_with_ancestor(child_tag, ancestors, child_loc, ance
export function is_tag_valid_with_parent(child_tag, parent_tag, child_loc, parent_loc) {
if (child_tag.includes('-') || parent_tag?.includes('-')) return null; // custom elements can be anything
if (parent_tag === 'template') return null; // no errors or warning should be thrown in immediate children of template tags
const disallowed = disallowed_children[parent_tag];
const child = child_loc ? `\`<${child_tag}>\` (${child_loc})` : `\`<${child_tag}>\``;

@ -0,0 +1,6 @@
<template>
<tr>
<td></td>
<td></td>
</tr>
</template>
Loading…
Cancel
Save