tweak message slightly, so it doesn't sound like the bad element is the one we're currently encountering

pull/14445/head
Rich Harris 2 years ago
parent 230f396315
commit a3a975f8a4

@ -212,12 +212,12 @@ export function is_tag_valid_with_parent(tag, parent_tag) {
case 'thead': case 'thead':
case 'tbody': case 'tbody':
case 'tfoot': case 'tfoot':
return `\`<${tag}>\` must be the child of a \`<table>\` (but got \`<${parent_tag}>\`)`; return `\`<${tag}>\` must be the child of a \`<table>\`, not a \`<${parent_tag}>\``;
case 'td': case 'td':
case 'th': case 'th':
return `\`<${tag}>\` must be the child of a \`<tr>\` (but got \`<${parent_tag}>\`)`; return `\`<${tag}>\` must be the child of a \`<tr>\`, not a \`<${parent_tag}>\``;
case 'tr': case 'tr':
return `\`<tr>\` must be the child of a \`<thead>\`, \`<tbody>\`, or \`<tfoot>\` (but got \`<${parent_tag}>\`)`; return `\`<tr>\` must be the child of a \`<thead>\`, \`<tbody>\`, or \`<tfoot>\`, not a \`<${parent_tag}>\``;
} }
return null; return null;

@ -1,7 +1,7 @@
[ [
{ {
"code": "node_invalid_placement", "code": "node_invalid_placement",
"message": "`<tbody>` must be the child of a `<table>` (but got `<div>`). The browser will 'repair' the HTML (by moving, removing, or inserting elements) which breaks Svelte's assumptions about the structure of your components.", "message": "`<tbody>` must be the child of a `<table>`, not a `<div>`. The browser will 'repair' the HTML (by moving, removing, or inserting elements) which breaks Svelte's assumptions about the structure of your components.",
"start": { "start": {
"line": 8, "line": 8,
"column": 1 "column": 1

Loading…
Cancel
Save