Here's a question for you that I'm curious about:
Do you validate your HTML? (For example, using the Nu HTML Checker https://validator.nu/ or the W3C Markup validator https://validator.w3.org) And why?
Here's a question for you that I'm curious about:
Do you validate your HTML? (For example, using the Nu HTML Checker https://validator.nu/ or the W3C Markup validator https://validator.w3.org) And why?
Hi @SaraSoueidan,
yes, and it's a habit when editing html to pass it through html tidy.
The habit is dating back to the days http://acid3.acidtests.org when browsers weren't compliant to a standard - and now I think (my) websites should be compliant.
Just for my assurance to write properly and get used to sane html and not just produce gibberish.
@SaraSoueidan no, because it's not very useful and is a pain to do so when the HTML is authored indirectly using a framework/template engine.
i instead try to validate the accessibility tree using Axe, either with a browser extension or in the CI. sometimes this also happens to catch invalid HTML
@SaraSoueidan I wanted to answer something along the lines that when you use a modern framework and modern tooling, you donāt need an HTML validator.
One validation of my SvelteKit website later, I am embarrassed š
I haven't validated HTML since the early 2000s?
Why? because I write flawless HTML š¤”
Bahahahaā¦more seriously, most of my HTML is simple enough that it would be hard *not* to pass.
It also complains that media is not an allowed attribute on the meta element, only to link to the HTML spec that says media is an allowed attribute. The same for form@method="dialog" which is totally valid.
If I were to write HTML for a living still, I probably would validate more often, but these days, it just feels not worth my time (because I rarely make obvious mistakes due to the conservative way I write code). (2/2)
Seldom. As when I write plain HTML my IDE validates it already. And when I use more complex setups, typically the compiler already yells at me.
Firefox still has the highlight of broken HTML when doing view-source: what often helps when I check the server side returned code.
This said, quite seldom as others also already said, as some validations are valid, but will never harm anyone.
@SaraSoueidan Yes, because it helps me catch certain classes of errors, e.g. duplicate ids or invalid element nesting. I using a browser extension that, with a single click, can send the html of the currently open page to validator.w3.org.
If I may self-promote here, I even wrote a blog post about which exact kind of errors html validation can catch š https://angelika.me/2023/09/15/5-bugs-caused-by-invalid-html/
@SaraSoueidan
Almost never whole pages but snippets with some regularity to confirm there aren't errors or to read how it describes errors I'm pretty sure are there.
.nu seems to be a few versions behind /nu/, it doesn't recognize <search> or `popover`, for example, and thinks <dialog> is not supported in all browsers.