Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR/DOM rendering discrepancy #1686

Closed
Rich-Harris opened this issue Aug 24, 2018 · 2 comments
Closed

SSR/DOM rendering discrepancy #1686

Rich-Harris opened this issue Aug 24, 2018 · 2 comments
Labels
compiler Changes relating to the compiler feature request stale-bot

Comments

@Rich-Harris
Copy link
Member

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.

@stale
Copy link

stale bot commented Dec 24, 2021

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.

@stale stale bot added the stale-bot label Dec 24, 2021
@Rich-Harris
Copy link
Member Author

fixed in Svelte 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes relating to the compiler feature request stale-bot
Projects
None yet
Development

No branches or pull requests

4 participants