Hacker News new | ask | show | jobs
by goto11 1865 days ago
The headline says XHTML. HTML does not even have the self-closing tags the question is concerned about.
1 comments

The headline said that the author was specifically looking to avoid 'xhtml self-contained tags', but that doesn't mean they could assume the document they were looking in was valid XHTML - just that it might contain XHTML-style 'self-closing' tags.

I've seen plenty of plain HTML files that aren't well-formed XML yet contain <br/> tags.

Yeah the trailing slash in <br /> is legal in HTML, but it doesn't actually make the tag self-closing. For example <b /> is still an opening tag which require a </b>.