You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return`\`${child}\` cannot be a child of \`${parent}\``;
200
+
return`${child} cannot be a child of ${parent}`;
199
201
}
200
202
201
203
if('only'indisallowed&&disallowed.only){
202
204
if(disallowed.only.includes(child_tag)){
203
205
returnnull;
204
206
}else{
205
-
return`\`${child}\` cannot be a child of \`${parent}\`. \`<${parent_tag}>\` only allows these children: ${disallowed.only.map((d)=>`\`<${d}>\``).join(', ')}`;
207
+
return`${child} cannot be a child of ${parent}. \`<${parent_tag}>\` only allows these children: ${disallowed.only.map((d)=>`\`<${d}>\``).join(', ')}`;
206
208
}
207
209
}
208
210
}
@@ -220,16 +222,16 @@ export function is_tag_valid_with_parent(child_tag, parent_tag, child_loc, paren
220
222
case'frame':
221
223
case'head':
222
224
case'html':
223
-
return`\`${child}\` cannot be a child of \`${parent}\``;
225
+
return`${child} cannot be a child of ${parent}`;
224
226
case'thead':
225
227
case'tbody':
226
228
case'tfoot':
227
-
return`\`${child}\` must be the child of a \`<table>\`, not a \`${parent}\``;
229
+
return`${child} must be the child of a \`<table>\`, not a ${parent}`;
228
230
case'td':
229
231
case'th':
230
-
return`\`${child}\` must be the child of a \`<tr>\`, not a \`${parent}\``;
232
+
return`${child} must be the child of a \`<tr>\`, not a ${parent}`;
231
233
case'tr':
232
-
return`\`<tr>\` must be the child of a \`<thead>\`, \`<tbody>\`, or \`<tfoot>\`, not a \`${parent}\``;
234
+
return`\`<tr>\` must be the child of a \`<thead>\`, \`<tbody>\`, or \`<tfoot>\`, not a ${parent}`;
Copy file name to clipboardExpand all lines: packages/svelte/tests/runtime-runes/samples/invalid-html-ssr-ancestor/_config.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ export default test({
12
12
mode: ['hydrate'],
13
13
14
14
errors: [
15
-
'node_invalid_placement_ssr: `<form> (form.svelte:1:0)` cannot be a descendant of `<form> (main.svelte:5:0)`\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
15
+
'node_invalid_placement_ssr: `<form>` (form.svelte:1:0) cannot be a descendant of `<form>` (main.svelte:5:0)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
Copy file name to clipboardExpand all lines: packages/svelte/tests/runtime-runes/samples/invalid-html-ssr/_config.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,8 @@ export default test({
12
12
mode: ['hydrate'],
13
13
14
14
errors: [
15
-
'node_invalid_placement_ssr: `<h1> (h1.svelte:1:0)` cannot be a child of `<p> (main.svelte:6:0)`\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.',
16
-
'node_invalid_placement_ssr: `<form> (form.svelte:1:0)` cannot be a child of `<form> (main.svelte:9:0)`\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
15
+
'node_invalid_placement_ssr: `<h1>` (h1.svelte:1:0) cannot be a child of `<p>` (main.svelte:6:0)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.',
16
+
'node_invalid_placement_ssr: `<form>` (form.svelte:1:0) cannot be a child of `<form>` (main.svelte:9:0)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
Copy file name to clipboardExpand all lines: packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/_config.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,6 @@ export default test({
6
6
},
7
7
8
8
errors: [
9
-
'node_invalid_placement_ssr: `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:1:0) cannot contain `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:2:1) (`<p>` cannot be a child of `<p>`)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
9
+
'node_invalid_placement_ssr: `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:2:1) cannot be a child of `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:1:0)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.'
<script>console.error("node_invalid_placement_ssr: `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:1:0) cannot contain `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:2:1) (`<p>` cannot be a child of `<p>`)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.")</script>
1
+
<script>console.error("node_invalid_placement_ssr: `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:2:1) cannot be a child of `<p>` (packages/svelte/tests/server-side-rendering/samples/invalid-nested-svelte-element/main.svelte:1:0)\n\nThis can cause content to shift around as the browser repairs the HTML, and will likely result in a `hydration_mismatch` warning.")</script>
0 commit comments