logoalt Hacker News

recursiveyesterday at 10:08 AM3 repliesview on HN

Img and br are not allowed to be closed.


Replies

swiftcoderyesterday at 10:16 AM

Worse, due to the aforementioned permissive error handling in HTML parsers, a closing </br> tag will end up inserting a second line break

hnlmorgyesterday at 10:25 AM

You close them in the same tag:

    <br/>
show 1 reply
imiricyesterday at 10:18 AM

Wrong.[1]

> if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/)

If you're going to be pedantic, at least be correct about it.

[1]: https://html.spec.whatwg.org/multipage/syntax.html#start-tag...

show 2 replies