validator / validator

Nu Html Checker – Helps you catch problems in your HTML/CSS/SVG
https://validator.github.io/validator/
MIT License
1.71k stars 275 forks source link

Different output from standalone web server and «validator.w3.org/nu» in v17.1.0 #444

Closed Arttse closed 7 years ago

Arttse commented 7 years ago

Look at this example:

<!DOCTYPE html>
<html>
<head>
    <title>Test</title>
    <link rel='https://api.w.org/' href='https://site.com/wp-json/' />
</head>
<body>
<p></p>
</body>
</html>

This link rel api string from WordPress CMS.

In https://validator.w3.org/nu output: Document checking completed. No errors or warnings to show.

In standalone web server output: Error: Bad value https://api.w.org/ for attribute rel on element link: The string https://api.w.org/ is not a registered keyword.

Validator version 17.1.0.

nschonni commented 7 years ago

The standalone Jar uses the WHATWG ruleset like https://checker.html5.org/ rather than the W3C rules so you'll see the same issue validating their.

sideshowbarker commented 7 years ago

The standalone Jar uses the WHATWG ruleset like https://checker.html5.org/ rather than the W3C rules so you'll see the same issue validating their.

That’s right. The reason is that while the jar and https://checker.html5.org/ support RDFa Lite, they intentionally do not support full RDFa. The only public instance of the checker that does support full RDFa is the W3C service, and if I were allowed to remove full RDFa support there too, I would.

Arttse commented 7 years ago

Thanks for replies. Could you provide data to build vnu.jar with rules W3C for https://validator.w3.org/nu? Thanks!

sideshowbarker commented 7 years ago

Could you provide data to build vnu.jar with rules W3C for https://validator.w3.org/nu?

Sure. See https://github.com/validator/validator/issues/407#issuecomment-260550358 but also copied in below.

python build/build.py \
  --name="Ready to check" \
  --results-title="Showing results" \
  --page-template="site/NuPageEmitter.xml" \
  --form-template="site/NuFormEmitter.xml" \
  --about-file="site/nu-about.html" \
  --script-file="site/nu-script.js" \
  --stylesheet-file="site/nu-style.css" \
  --presets-file="resources/nu-presets.txt" \
  --follow-w3c-spec \
  --html5link=http://www.w3.org/html/wg/drafts/html/master/single-page.html \
  update dldeps build jar

The only option there that actually affects document checking is the --follow-w3c-spec. The rest of those options only affect how information is presented in the Web UI.