Closed usmonster closed 7 years ago
The W3C Validator that Validity uses implements it's HTML5 support through the Nu Checker, so I'm not sure supporting the Nu Checker directly would give any particular advantage. It would also likely complicate configuration if the API differs and add another area to test for future development.
Do you have a particular use case to choose the Nu Checker directly over the W3C Validator?
My use case is that I have a Nu Validator instance running locally, and I want to force checking with the HTML5 rules only, even if a page might be detected as (i.e. incorrectly declared with) a different doctype. I guess I can investigate whether there's a way to force that on the command line for the legacy/W3C checker, though it might not be possible to do that as it stands. (Update: Looks like it's possible by adding ?doctype=html5
to the custom URL.)
The larger issue is that even the W3C recommends using the Nu Checker directly instead of the legacy W3C validator when checking HTML5, according to some comments I've seen on the mailing list.
To address your concerns, it would seem that the simplest and cleanest way to support both services is to work with the JSON output instead of using and parsing SOAP output as is currently done. Here is the documentation from both the W3C Validator and the Nu Checker: https://validator.w3.org/docs/users.html#Output https://github.com/validator/validator/wiki/Service%3A-HTTP-interface#output-modes
Please note that the docs for the W3C validator says its JSON output format is "equivalent to the JSON output for validator.nu."
So what do you say? Please let me know if this enhancement can be strongly considered. Thanks!
@renyard, any further feedback on this request? Please note that it has been updated to emphasize the actual change that would be required--support the JSON output instead of SOAP. This is the common format supported across all versions of the HTML checker, and should actually simplify your plug-in code and make it more maintainable.
Please let me know if you have any questions, and I can probably even take a look at making a pull request. Thanks again!
I have been thinking about this and would like to move to the JSON format. Validity did originally use the JSON feed, but this was changed somewhere around version 1.0, as older versions of the validator, including the one in the Ubuntu repos did not include JSON support.
Before making the change, I'd like to try and get an idea of if there are still users who would be impacted by this change. So, in the next version I'm going to add some further analytics to work out how many users are using the custom validator feature. (This won't be conclusive but will give an upper limit of potential impact.)
Once I have some stats on this, I can use these to decide if I'm going to need to keep the legacy XML code or if I can move everyone to the JSON feed with minimal user impact.
:+1: Thanks for the quick response! Sounds like a good approach.
(Also worth noting is that the Nu HTML Checker is now exactly the W3C Validator.. Just noticed that in the official docs. :)
Hello, @renyard! Any progress on getting stats for this?
Yes, I now have the stats and custom validator usage is very low, so I think it's safe to make this change.
Making the change to the Nu Validator is quite high on my priority list for Validity, so this is something that I hope to have time to implement in the next few months.
Thanks, @renyard, this is great news! Are pull requests welcome? (Though you might get a chance before I do...)
I've just deployed Validity v4.0.0, which now uses the Nu Validator by default. I'm rolling this out gradually, as it's a big change, so you may need to uninstall and reinstall from the Chrome Web Store Page to get the update.
It would be nice to be able to optionally choose between the default w3c validation service and the Nu Checker, even when pointing to a custom URL.(<- old description)According to W3C, the legacy (current) W3C validator's JSON output format is "equivalent to the JSON output for validator.nu." : https://validator.w3.org/docs/users.html#Output https://github.com/validator/validator/wiki/Service%3A-HTTP-interface#output-modes
Updating the extension to request and parse validation results output as JSON (instead of SOAP, as it does now) will allow your checker to be used by those who prefer to use the standalone HTML5 checker, which is more modern and less buggy for this purpose, without changing anything for current users or complicating the extension's development process. See also: https://github.com/validator/validator https://validator.w3.org/nu/ https://validator.w3.org/nu/about.html