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 'tbody':
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 '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':
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;

@ -1,7 +1,7 @@
[
{
"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": {
"line": 8,
"column": 1

Loading…
Cancel
Save