Hello.
I have HTML:
<div>
<span><i></i></span>
<span><i></i></span>
</div>
But Svelte outputs it in the following way:
<div>
<span><i></i></span>
<i>
<span><i></i></span>
</i>
</div>
I'm using version 1.4.0.
You can see it there: https://svelte.technology/repl?version=1.40.0&gist=5061e03f1ec98ae67e0e7d7a3da4963e
Wow, that's nuts. This works...
div.innerHTML = "<span><i></i></span>\n\t<span><i></i></span>";
...but this (the code that's being generated) fails:
div.innerHTML = "<span><i/></span>\n\t<span><i/></span>";
I wonder what condition determines whether you can use a self-closing tag versus when you must have an opening and a closing tag.
https://stackoverflow.com/questions/3558119/are-non-void-self-closing-tags-valid-in-html5 It sounds like according to the spec only void elements are allowed to be self-closing. I don't know how that corresponds to this weird behavior exactly, but it would probably be wise to only output self-closing elements for things we know are void elements - or actually to just output the lone tag e.g. <input> instead of <input/> to save a character.
@Conduitry your branch working for me very well.
Released 1.40.1 with the fix — thanks