We currently send all new SVGs to the W3C validator.
|
await fetch("https://validator.w3.org/nu/?out=gnu", { |
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?
We currently send all new SVGs to the W3C validator.
SuperTinyIcons/test/test.js
Line 38 in 2ef9ad6
This sometimes fails valid files with:
Is there a way to validate SVGs locally?
Some things I've tried which don't really work:
❌ https://github.com/ietf-tools/svgcheck
❓ https://github.com/validator/validator/releases
genericrole w3c/svg-aam#21) so that needs to be manually removed.java -jarin an action.❌ https://github.com/sindresorhus/is-svg
Any other thoughts?