Just encountered an interesting bug. The Svelte SSR compiler uses self-closing tags for elements without children:
<div/> <!-- equivalent to <div></div> -->
But that doesn't work with some elements:
<a href='https://whatever.com'/>
<p>this will be included in the link!</p>
It needs to be <a ...></a> instead. Empty anchor tags is a bit of an edge case, but it should still be handled. Am wondering which other elements can't use self-closing tags though. A quick Google doesn't yield anything interesting – does anyone out there know the answer? Or should we just always use closing tags for non-void elements?
Just encountered an interesting bug. The Svelte SSR compiler uses self-closing tags for elements without children:
But that doesn't work with some elements:
It needs to be
<a ...></a>instead. Empty anchor tags is a bit of an edge case, but it should still be handled. Am wondering which other elements can't use self-closing tags though. A quick Google doesn't yield anything interesting – does anyone out there know the answer? Or should we just always use closing tags for non-void elements?