Replace W3C validator check

Author: edentCreated Oct 27, 2025Updated Oct 28, 2025

We currently send all new SVGs to the W3C validator.

https://github.com/edent/SuperTinyIcons/blob/2ef9ad6f343b4da2e1668424d87662c593581cc4/test/test.js#L38

This sometimes fails valid files with:

  1) images/svg/example.svg
       should be validated by the w3c validator:
     AssertionError: expected '<!DOCTYPE html><html lang="en-US"><he…' to be empty
      at /home/runner/work/SuperTinyIcons/SuperTinyIcons/test/test.js:45:38
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Context.<anonymous> (test/test.js:38:13)

Is there a way to validate SVGs locally?

Some things I've tried which don't really work:

https://github.com/ietf-tools/svgcheck

  • Doesn't allow short colours "The attribute 'fill' does not allow the value '#fff', replaced with 'white'"

https://github.com/validator/validator/releases

https://github.com/sindresorhus/is-svg

  • Validator seems very weak. Approves files even with broken whitespace or extra text at the end.

Any other thoughts?