4 ms·
Not every html tag has a closing tag. "<br />" parsing is supported in html5 as recognizing self closing xml tags is necessary due to people publishing xhtml wi
by olliej 3y ago
Not every html tag has a closing tag. "<br />" parsing is supported in html5 as recognizing self closing xml tags is necessary due to people publishing xhtml with an html mime type. But to be clear it's incorrect: <br>...</br> is incorrect as <br> is a self closing tag, so the closing tag itself is erroneous.
In terms of validation: html5 has a specified parsing algorithm, you can validate html against it. That validation is not xml validation. Again, because html is not xml.
There is a very clear specification about how html tags are parsed, trying to reason about html as if it is xml is just as (if not more) incorrect than trying to reason about C as if it were C++. e.g.
void f();
Is a different type in C than it is in C++, but if you do this you can't turn around and complain that C and C++ see it as having a different type when the syntax has different meanings.
- the_why_of_y 3y agoThe reason why people served XHTML as text/html was that Microsoft Internet Explorer didn't recognize application/xhtml+xml. https://hixie.ch/advocacy/xhtml https://hixie.ch/advocacy/xhtml https://www.w3.org/2003/01/xhtml-mimetype/ https://www.w3.org/2003/01/xhtml-mimetype/
- imtringued 3y agoI serve it because my PDF library only supports XHTML and I'm not going to have twice as much HTML just to add a / to br tags.
- sigsev_251 3y agoK&R functions were removed from the standard in C23. That function declaration means the same thing now in both languages.
- teo_zero 3y agoYou surely meant will be removed in C23?