Support @html in `<title>` tag
### Describe the problem
Svelte doesn't support the `<title>` tag containing `{@html ...}`:
```svelte
<script>
const htmlTitle = "Czecho­slovak";
</script>
<svelte:head>
<title>{@html htmlTitle}</title>
</svelte:head>
```
```
`<title>` can only contain text and {tags}
https://svelte.dev/e/title_invalid_content
svelte[title_invalid_content](https://svelte.dev/docs/svelte/compiler-errors#title_invalid_content)
```
This is inconvenient for variable titles which contain XML markup that should be embedded directly, such as `­` or ` `. Without the `@html` directive, the XML entity gets mangled into `&shy;`.
### Describe the proposed solution
Svelte should relax this restriction, which seems arbitrary. Alternatively, Svelte should provide another way to pass variables containing XML entities to the `<title>` tag.
### Importance
would make my life easier
3 条评论