Here's a fun one. Svelte won't let you write malformed markup like this...
<p>
<div>you can't have a div inside a p</div>
</p>
But you can have a component inside the <p> element that has a <div>, or any other element that causes <p> to auto-close.
So in the example in the REPL above, the following markup gets generated...
<p><div>some text</div></p>
...which gets corrected by the browser's HTML parser to this...
<p></p>
<div>some text</div>
<p></p>
...until the client-side renderer takes over, at which point it becomes this again:
<p><div>some text</div></p>
This can cause some hard-to-diagnose flashes of glitchy content. I'm not sure what to do about this. Perhaps if the compiler had a birds-eye view of the component graph, it could respond accordingly.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Here's a fun one. Svelte won't let you write malformed markup like this...
But you can have a component inside the
<p>
element that has a<div>
, or any other element that causes<p>
to auto-close.So in the example in the REPL above, the following markup gets generated...
...which gets corrected by the browser's HTML parser to this...
...until the client-side renderer takes over, at which point it becomes this again:
This can cause some hard-to-diagnose flashes of glitchy content. I'm not sure what to do about this. Perhaps if the compiler had a birds-eye view of the component graph, it could respond accordingly.