don't allow children in svelte:options (#11250)

pull/11252/head
Jeremiasz Major 1 year ago committed by GitHub
parent f632b2a944
commit a764f4e88e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
breaking: don't allow children in svelte:options

@ -101,7 +101,7 @@ export default function tag(parser) {
if (root_only_meta_tags.has(name)) {
if (is_closing_tag) {
if (
(name === 'svelte:window' || name === 'svelte:body' || name === 'svelte:document') &&
['svelte:options', 'svelte:window', 'svelte:body', 'svelte:document'].includes(name) &&
/** @type {import('#compiler').ElementLike} */ (parent).fragment.nodes.length
) {
error(

@ -0,0 +1,9 @@
import { test } from '../../test';
export default test({
error: {
code: 'invalid-element-content',
message: '<svelte:options> cannot have children',
position: [16, 16]
}
});
Loading…
Cancel
Save