Just to remind you that <bold> <italic> text </bold> </italic> [0] that has been working for ages in every browser ever, is NOT a valid XHTML, and should be rejected by GP's proposal.
I, for one, is kinda happy that XHTML is dead.
[0]: By <bold> I mean <b> and by <italic> I mean <i>, and the reason it's not valid HTML is that the order of closing is not reverse of the order of opening as it should properly be.
That caused plenty of incompatibilities in the past. At one point, Internet Explorer would parse that and end up with something that wasn’t even a tree.
HTML is not a set of instructions that you follow. It’s a terrible format if you treat it that way.
XHTML allows you to use XML and <bold> <italic> are just XML nodes with no schema. The correct form has been and will always be <b> and <i>. Since the beginning.
Ooooo… now we’re talking. Sloppy HTML that closes a tag out of order or just declared out of order? Or rendering bugs when bold is before italic? It’s why XHTML should have been standard. Just dump, error out, make the developer fix it.
But the problem here is that our nice programmer-brained mental model does not match the actual requirements of text.
Unless you know about tree structures, it doesn’t make sense to the average person why you would have to stop and then restart a span of formatting options just because an unrelated attribute changed.
And that’s why XHTML failed - HTML is human-writable.
That’s not what the H stands for though… but I get what you’re saying. Because they opened in order, closing in same defined order should be allowed and thus we have all that peeking code to check to see if the next tag is that so we don’t error out and now we no longer conform to XHTML. Because non-engineers are writing HTML. It’s like putting the tires on before the brakes, but brakes after, and expecting it to work.
However because you can be both bold and italic, these should just be flags and that’s how they are now which is why b or i can be closed before b or i. I doubt they are just flags in the code of the browsers though because tags support styles and stuff.
I, for one, is kinda happy that XHTML is dead.
[0]: By <bold> I mean <b> and by <italic> I mean <i>, and the reason it's not valid HTML is that the order of closing is not reverse of the order of opening as it should properly be.