| HTML can't be fixed with a small trick like that. Just use templating engine like Pug and get away with most of the annoyances. It's concise about what part of the text is covered by a certain tag due to forced indentation, not to mention you'll never need to close any tag and you never write "class=" but are all turned into CSS selector notation among many other tricks. https://github.com/pugjs/pug#syntax Unless the HTML I'm composing will be touched by people like designers who would get scared of new syntax, in which case I'll use Twig or Nunjucks, I'll never write plain HTML for myself. There's also a very solid implementation in PHP as well. https://github.com/pug-php/pug You can either let server side (node.js or PHP) compile that on demand or let your editors compile them as you edit if you're working on a static file. I really think the language humans write should deviate from the language the runtimes understand to get all the convenience while never breaking how runtimes/crawlers interpret your output. Same goes for Stylus against CSS. |