-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<a> tags cannot be self-closing #200
Comments
According to http://stackoverflow.com/a/3558200 the answer is “it depends”. Maybe you should take a look at the HTML5 spec ;-) |
The spec suggests that all elements except void elements and foreign elements (i.e. SVG) need a closing tag. But browsers definitely parse things like |
Switch to XHTML if you want crashed in the renderer hides Jokes aside, would it be an option to omit the closing slash in a tag? AFAIK browser can deal with that better (have a look at |
Closing slashes are omitted for void elements, this is about 'normal' elements |
(highlighting mine) Can't you omit it on those normal elements as well? |
Where is that pasted from? |
The StackOverflow question I've linked above. |
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?The text was updated successfully, but these errors were encountered: