DEV Community

Discussion on: Best Practices for HTML

Collapse
 
cookrdan profile image
Dan

Re: Validating HTML

There are some services that do HTML validation (I didn't know about this). This relates to the topic of best practices. But, I think that a validator can't determine everything for you. For example I doubt it would distinguish an error between using an em or strong tag.

So I dug around and I've found a few things that I'm going to experiment with. I haven't had time to try them all yet:

  • HTMLHint for VS Code will show problems in the problem panel.
  • w3c validator is extension for VS Code that is probably better than HTMLHint. It requires installing Java if you don't have it.
  • w3c-validator command line tool in python (looks outdated...maybe). The script just uploads html to w3c validator and then parses the json response.
  • validator.nu which has a command line script on the about page (also in python).

See also validator