3 ms·
> "Be conservative in what you do, be liberal in what you accept from others" Wikipedia has an example of a tag soup https://en.wikipedia.org/wiki/Tag_soup htt
by newjersey 11y ago
> "Be conservative in what you do, be liberal in what you accept from others"
Wikipedia has an example of a tag soup https://en.wikipedia.org/wiki/Tag_soup https://en.wikipedia.org/wiki/Tag_soup which is probably poster child example of this law:
<p>This is a malformed fragment of <em>HTML.</p></em>
What do we do here? Do we do what browsers have historically done? Or do we throw our hands up in the air when we see malformed tags?
- mbrock 11y agoHTML5 includes a well-defined algorithm for parsing such constructs, so with the HTML5 doctype that fragment is actually well-formed and normalized to the tree you'd expect.
- dTal 11y agoWait, if HTML5 specifies how to handle it... doesn't that make it syntactically valid?
- mbrock 11y agoThat's right as far as I can tell. For another example of markup that's entirely valid in HTML5 but still considered icky by some people, the spec section on tag omission has an example of how to write tables more easily by skipping all the end tags.