Replace W3C validator check
Author: edentCreated Oct 27, 2025Updated Oct 28, 2025
We currently send all new SVGs to the W3C validator.
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
- Doesn't allow the aria-label (see https://github.com/w3c/svg-aam/issues/21) so that needs to be manually removed.
- Not sure how to run a
java -jarin an action.
❌ 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?
Source: edent/SuperTinyIcons