5 ms·
You shouldn't have to remember it, but you editor could and should.
by BurningFrog 10y ago
You shouldn't have to remember it, but you editor could and should.
- scrollaway 10y agoIf you are writing <p>something <div>like this</div><p> then your editor knows you are making a mistake and can highlight it. If on the other hand you are not closing tags that autoclose, how can your editor tell you? There is no way to know it's not intended.
- BurningFrog 10y agoThe editor could have a setting for that. But mostly I meant that you don't have to close the autoclosing tags.
- Arnavion 10y agoXML validators are much more common in editors than HTML validators, probably because XML is both easier to parse and used for a lot more than XHTML.
- DonHopkins 10y agoI write and edit all my Genshi [1] templates as xhtml, so I can validate and process them as crisp clean hi-fidelity xml, and then pump them out to browsers with the html serializer [2]. If I were inclined to follow Google's guidelines on omitting optional tags, it would be easy to write a stream filter that removed them [3]. But I prefer source templates to have all the explicit properly indented structure, so they're easier to validate and process with XML tools (and by eye), and unintentional mistakes don't sneak through as easily. For the same reason, I also prefer not to write minified JavaScript source code: that should be done by post-processors, no humans. ;) [1] https://genshi.edgewall.org/ https://genshi.edgewall.org/ [2] https://genshi.edgewall.org/wiki/ApiDocs/genshi.output https://genshi.edgewall.org/wiki/ApiDocs/genshi.output [3] https://genshi.edgewall.org/wiki/Documentation/streams.html#serialization https://genshi.edgewall.org/wiki/Documentation/streams.html#...