Skip to content

Commit 57343fa

Browse files
Update packages/svelte/messages/compile-errors/template.md
Co-authored-by: Simon H <[email protected]>
1 parent 3d6a972 commit 57343fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/svelte/messages/compile-errors/template.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,12 @@
192192

193193
> %thing% is invalid inside `<%parent%>`
194194
195-
HTML has some restrictions where certain elements can appear. For example, a `<div>` inside a `<p>` is invalid. Some violations "only" result in invalid HTML, others result in the HTML being repaired by the browser, resulting in content shifting around. Some examples:
195+
HTML restricts where certain elements can appear. In case of a violation the browser will 'repair' the HTML in a way that breaks Svelte's assumptions about the structure of your components. Some examples:
196196

197-
- `<p>hello <div>world</div></p>` will result in `<p>hello </p><div>world</div><p></p>` for example (the `<div>` autoclosed the `<p>`)
197+
- `<p>hello <div>world</div></p>` will result in `<p>hello </p><div>world</div><p></p>` for example (the `<div>` autoclosed the `<p>` because `<p>` cannot contain block-level elements)
198198
- `<option><div>option a</div></option>` will result in `<option>option a</option>` (the `<div>` is removed)
199199
- `<table><tr><td>cell</td></tr></table>` will result in `<table><tbody><tr><td>cell</td></tr></tbody></table>` (a `<tbody>` is auto-inserted)
200200

201-
Svelte throws a compiler error when it detects that it will generate the HTML in such a way that it will always be repaired and result in the runtime code not finding the nodes at the expected locations.
202-
203201
## render_tag_invalid_call_expression
204202

205203
> Calling a snippet function using apply, bind or call is not allowed

0 commit comments

Comments
 (0)