From a3a975f8a4e2f04de2be27730fce5ac0be66e787 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 30 Nov 2024 13:46:20 -0500 Subject: [PATCH] tweak message slightly, so it doesn't sound like the bad element is the one we're currently encountering --- packages/svelte/src/html-tree-validation.js | 6 +++--- .../validator/samples/invalid-node-placement-7/errors.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/svelte/src/html-tree-validation.js b/packages/svelte/src/html-tree-validation.js index 8cb47d7b96..25e15bcfa7 100644 --- a/packages/svelte/src/html-tree-validation.js +++ b/packages/svelte/src/html-tree-validation.js @@ -212,12 +212,12 @@ export function is_tag_valid_with_parent(tag, parent_tag) { case 'thead': case 'tbody': case 'tfoot': - return `\`<${tag}>\` must be the child of a \`\` (but got \`<${parent_tag}>\`)`; + return `\`<${tag}>\` must be the child of a \`
\`, not a \`<${parent_tag}>\``; case 'td': case 'th': - return `\`<${tag}>\` must be the child of a \`\` (but got \`<${parent_tag}>\`)`; + return `\`<${tag}>\` must be the child of a \`\`, not a \`<${parent_tag}>\``; case 'tr': - return `\`\` must be the child of a \`\`, \`\`, or \`\` (but got \`<${parent_tag}>\`)`; + return `\`\` must be the child of a \`\`, \`\`, or \`\`, not a \`<${parent_tag}>\``; } return null; diff --git a/packages/svelte/tests/validator/samples/invalid-node-placement-7/errors.json b/packages/svelte/tests/validator/samples/invalid-node-placement-7/errors.json index c847f3fddc..a1422c001a 100644 --- a/packages/svelte/tests/validator/samples/invalid-node-placement-7/errors.json +++ b/packages/svelte/tests/validator/samples/invalid-node-placement-7/errors.json @@ -1,7 +1,7 @@ [ { "code": "node_invalid_placement", - "message": "`` must be the child of a `
` (but got `
`). The browser will 'repair' the HTML (by moving, removing, or inserting elements) which breaks Svelte's assumptions about the structure of your components.", + "message": "`
` must be the child of a `
`, not a `
`. The browser will 'repair' the HTML (by moving, removing, or inserting elements) which breaks Svelte's assumptions about the structure of your components.", "start": { "line": 8, "column": 1