Description
Describe the bug
Components containing a raw {@html}
tag at the top level are hydrated incorrectly - the existing HTML is not removed.
Logs
None.
To Reproduce
Attempt to hydrate a component containing a top-level {@html}
tag against some existing HTML.
Expected behavior
The existing HTML should be replaced, but it is not.
Stacktraces
None
Information about your Svelte project:
- Firefox 74
- Windows 10
- Svelte 3.19.2
- Rollup
Severity
Inconvenient. For my case, I can wrap it in another element without affecting much.
Additional context
There appears to be a disabled and outdated test for this here. If I enable it and add the required export let raw;
prop declaration to the component, the test fails with the same thing I'm seeing in practice - that there are two copies of the HTML upon hydration.
I'm also not entirely certain the problem I'm asking to be fixed here is well defined. How can we know how much the {@html}
should 'consume' during hydration?