mirror of https://github.com/sveltejs/svelte
[fix] Fix hydration duplicate `svelte:head` tag issue with `@html` expressions and nested components (#7745)
* Fix hydration duplicate `svelte:head` tag issue with `@html` and nested components #7444 #6463 * - Changed comment style to HEAD_${head_id}_START and HEAD_${head_id}_END - Improved claim logic - Changed tests accordinglypull/7693/head
parent
7ac3854613
commit
8ffc8fd77b
@ -0,0 +1,2 @@
|
||||
{@html '<meta name="head_nested_html" content="head_nested_html">'}
|
||||
<meta name="head_nested" content="head_nested">
|
@ -0,0 +1,5 @@
|
||||
|
||||
<svelte:head>
|
||||
{@html '<meta name="nested_html" content="nested_html">'}
|
||||
<meta name="nested" content="nested">
|
||||
</svelte:head>
|
@ -0,0 +1,12 @@
|
||||
<!-- HEAD_svelte-17ibcve_START -->
|
||||
<!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END -->
|
||||
<meta name="main" content="main">
|
||||
<!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="head_nested" content="head_nested">
|
||||
<!-- HEAD_svelte-17ibcve_END -->
|
||||
|
||||
<!-- HEAD_svelte-1gqzvnn_START -->
|
||||
<!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="nested" content="nested">
|
||||
<!-- HEAD_svelte-1gqzvnn_END -->
|
||||
|
@ -0,0 +1,11 @@
|
||||
<!-- HEAD_svelte-17ibcve_START -->
|
||||
<!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END -->
|
||||
<meta name="main" content="main">
|
||||
<!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="head_nested" content="head_nested">
|
||||
<!-- HEAD_svelte-17ibcve_END -->
|
||||
|
||||
<!-- HEAD_svelte-1gqzvnn_START -->
|
||||
<!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="nested" content="nested">
|
||||
<!-- HEAD_svelte-1gqzvnn_END -->
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import HeadNested from './HeadNested.svelte';
|
||||
import Nested from './Nested.svelte';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{@html '<meta name="main_html" content="main_html">'}
|
||||
<meta name="main" content="main">
|
||||
<HeadNested />
|
||||
</svelte:head>
|
||||
|
||||
<Nested/>
|
@ -1,4 +1,6 @@
|
||||
<title>Some Title</title>
|
||||
<link href="/" rel="canonical">
|
||||
<meta content="some description" name="description">
|
||||
<meta content="some keywords" name="keywords">
|
||||
<!-- HEAD_svelte-1s8aodm_START -->
|
||||
<link rel="canonical" href="/">
|
||||
<meta name="description" content="some description">
|
||||
<meta name="keywords" content="some keywords">
|
||||
<!-- HEAD_svelte-1s8aodm_END -->
|
||||
|
@ -1,4 +1,6 @@
|
||||
<title>Some Title</title>
|
||||
<link rel="canonical" href="/" data-svelte="svelte-1s8aodm">
|
||||
<meta name="description" content="some description" data-svelte="svelte-1s8aodm">
|
||||
<meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm">
|
||||
<!-- HEAD_svelte-1s8aodm_START -->
|
||||
<link rel="canonical" href="/">
|
||||
<meta name="description" content="some description">
|
||||
<meta name="keywords" content="some keywords">
|
||||
<!-- HEAD_svelte-1s8aodm_END -->
|
||||
|
@ -0,0 +1,2 @@
|
||||
{@html '<meta name="head_nested_html" content="head_nested_html">'}
|
||||
<meta name="head_nested" content="head_nested">
|
@ -0,0 +1,5 @@
|
||||
|
||||
<svelte:head>
|
||||
{@html '<meta name="nested_html" content="nested_html">'}
|
||||
<meta name="nested" content="nested">
|
||||
</svelte:head>
|
@ -0,0 +1,11 @@
|
||||
<!-- HEAD_svelte-17ibcve_START -->
|
||||
<!-- HTML_TAG_START --><meta name="main_html" content="main_html"><!-- HTML_TAG_END -->
|
||||
<meta name="main" content="main">
|
||||
<!-- HTML_TAG_START --><meta name="head_nested_html" content="head_nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="head_nested" content="head_nested">
|
||||
<!-- HEAD_svelte-17ibcve_END -->
|
||||
|
||||
<!-- HEAD_svelte-1gqzvnn_START -->
|
||||
<!-- HTML_TAG_START --><meta name="nested_html" content="nested_html"><!-- HTML_TAG_END -->
|
||||
<meta name="nested" content="nested">
|
||||
<!-- HEAD_svelte-1gqzvnn_END -->
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import HeadNested from './HeadNested.svelte';
|
||||
import Nested from './Nested.svelte';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{@html '<meta name="main_html" content="main_html">'}
|
||||
<meta name="main" content="main">
|
||||
<HeadNested />
|
||||
</svelte:head>
|
||||
|
||||
<Nested/>
|
@ -1,4 +1,6 @@
|
||||
<title>Some Title</title>
|
||||
<link rel="canonical" href="/" data-svelte="svelte-1s8aodm">
|
||||
<meta name="description" content="some description" data-svelte="svelte-1s8aodm">
|
||||
<meta name="keywords" content="some keywords" data-svelte="svelte-1s8aodm">
|
||||
<!-- HEAD_svelte-1s8aodm_START -->
|
||||
<link rel="canonical" href="/">
|
||||
<meta name="description" content="some description">
|
||||
<meta name="keywords" content="some keywords">
|
||||
<!-- HEAD_svelte-1s8aodm_END -->
|
||||
|
Loading…
Reference in new issue