3 ms·
The HTML spec is bigger than the web, and consumed by other specifications produced by standards bodies like W3. So for example, ePub expects well-formed XHTML,
by robin_reala 3y ago
The HTML spec is bigger than the web, and consumed by other specifications produced by standards bodies like W3. So for example, ePub expects well-formed XHTML, which includes closing tags.[1] The HTML spec to this day still has XML-compatibility sections.[2][3]
Of course, feel free to do what you want on the web.
[1] https://www.w3.org/TR/epub-33/#sec-xhtml https://www.w3.org/TR/epub-33/#sec-xhtml
[2] https://html.spec.whatwg.org/#xml https://html.spec.whatwg.org/#xml
[3] https://html.spec.whatwg.org/#the-xhtml-syntax https://html.spec.whatwg.org/#the-xhtml-syntax
- Finnucane 3y agoFor ebooks, we don't rely on the browser to know what to do with sloppy code, because the reader may be not a browser. It may be a Kindle or worse. So being able to strictly validate is a benefit. Also, being able to use xml-based tools for editing and creating is a bonus.
- spankalee 3y agoPrettier won't guarantee XML well-formedness. You should use a different tool for that, or an XML pluggin for Prettier.