Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I understand it correctly, The `<foo />` syntax is an XML invention. It was never added to HTML. Traditional HTML parsers see the slash as a malformed attribute and ignore it, and that behavior was codified in HTML5.


The whole "we want to look like XML, but not /be/ XML" has to be one of the most annoying aspects of it. I shouldn't be too surprised on this particular edge, but holy crap I also wouldn't be shocked to know that I did it wrong in some pages.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: