sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

@html in <svelte:head> isn't cleaned between page changes #1425

Open mattpilott opened 4 years ago

mattpilott commented 4 years ago

Describe the bug If for some reason you need to use the html parser in svelte:head it duplicates the initial value and then only updates one of them on page change leading to initially duplicate html in the head followed by duplicate tags but with different data on page change. This may possibly yield some SEO issues

Logs N/A

To Reproduce https://github.com/matt3224/svelte-head

Expected behaviour I expect only one instance to exist

Stacktraces N/A

Information about your Sapper Installation:

  System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
    Memory: 955.55 MB / 24.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.8.0 - /usr/local/bin/node
    npm: 6.14.8 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 84.1.12.112
    Chrome: 84.0.4147.105
    Firefox: 79.0
    Safari: 13.1.2
    Safari Technology Preview: 14.0
  npmPackages:
    rollup: ^2.3.4 => 2.26.4 
    sapper: ^0.28.0 => 0.28.0 
    svelte: ^3.17.3 => 3.24.1 

Severity This is minor oddity, hopefully it doesn't have a negative impact on SEO

Additional context Thanks!

antony commented 4 years ago

Sapper doesn't do anything about removal of tags or deduplication at all. I think the use of @html in this is a red herring. Can you verify?

mattpilott commented 4 years ago

@antony https://github.com/matt3224/svelte-head/tree/without-%40html

Works how i would expect without @html