mirror of https://github.com/sveltejs/svelte
fix: remove raw-text hydration markers (#18269)
Fixes #14413. This keeps the temporary raw-text hydration sentinel used by dynamic `<svelte:element>` from becoming part of the final DOM. Hydration still gets a marker to advance through for raw-text children, but the marker is removed after the child renderer runs, so `<style>` and `<script>` contents stay identical to SSR output. Tests: - `pnpm test hydration -t svelte-head-dynamic-style` - `pnpm test hydration` - `pnpm test runtime-runes -t svelte-element` - `pnpm lint` - `git diff --check` --------- Co-authored-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/18271/head
parent
04d408b29d
commit
8b961be0b1
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: remove temporary raw-text hydration markers
|
||||||
@ -1 +1 @@
|
|||||||
<!--[--><!----><script>{}<!----></script><!----><!--]-->
|
<!--[--><!----><script>{}</script><!----><!--]-->
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
props: {
|
||||||
|
css: 'body { color: red; }'
|
||||||
|
}
|
||||||
|
});
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
<script>
|
||||||
|
let { css } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<svelte:element this="style" type="text/css">{css}</svelte:element>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<p>content</p>
|
||||||
Loading…
Reference in new issue