From 5c08aba5d99c7454ad3cab1ea4229d487e8a8d5b Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 26 Jul 2024 13:08:44 +0200 Subject: [PATCH] move more of the validation into more descriptive record --- packages/svelte/src/html-tree-validation.js | 177 ++++++++------------ 1 file changed, 67 insertions(+), 110 deletions(-) diff --git a/packages/svelte/src/html-tree-validation.js b/packages/svelte/src/html-tree-validation.js index 123d158c76..295fa688a9 100644 --- a/packages/svelte/src/html-tree-validation.js +++ b/packages/svelte/src/html-tree-validation.js @@ -89,142 +89,99 @@ export function closing_tag_omitted(current, next) { /** * Map of elements that have certain elements that are not allowed inside them, in the sense that the browser will somehow repair the HTML. * There are more elements that are invalid inside other elements, but they're not repaired and so don't break SSR and are therefore not listed here. - * @type {Record} + * @type {Record} */ const disallowed_children = { ...autoclosing_children, + optgroup: { only: ['option', '#text'] }, + // Strictly speaking, seeing an