-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: repair invalid raw html content during hydration
When the HTML that is coming from raw html is invalid, the browser reshuffles things. Bail in that case to try to repair more often. Should help with withastro/astro#7557
- Loading branch information
1 parent
35221c8
commit 68b5faa
Showing
6 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: repair invalid raw html content during hydration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/svelte/test/hydration/samples/raw-repair/_after.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<p><p>invalid</p></p> | ||
<p><p>invalid</p></p> |
8 changes: 8 additions & 0 deletions
8
packages/svelte/test/hydration/samples/raw-repair/_before.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<p><!-- HTML_TAG_START --></p> | ||
<p>invalid</p> | ||
<!-- HTML_TAG_END --> | ||
<p></p> | ||
<p><!-- HTML_TAG_START --></p> | ||
<p>invalid</p> | ||
<!-- HTML_TAG_END --> | ||
<p></p> |
5 changes: 5 additions & 0 deletions
5
packages/svelte/test/hydration/samples/raw-repair/inner.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let content; | ||
</script> | ||
|
||
<p>{@html content}</p> |
7 changes: 7 additions & 0 deletions
7
packages/svelte/test/hydration/samples/raw-repair/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script> | ||
import Inner from './inner.svelte'; | ||
</script> | ||
|
||
<Inner content="<p>invalid</p>" /> | ||
|
||
<p>{@html '<p>invalid</p>'}</p> |
68b5faa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!