svenkreiss / html5validator

Command line tool to validate HTML5 files. Great for continuous integration.
MIT License
319 stars 34 forks source link

Upgrade Insecure Requests is thought as invalid #9

Closed Mikaela closed 8 years ago

Mikaela commented 8 years ago

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests"> causes errors with the validator and according to #whatwg it's valid, but their validator hasn't been updated yet.

svenkreiss commented 8 years ago

Thanks for the report. Have you tried the --ignore option? This is a good way to work around this until it gets implemented in the actual validator backend.

Mikaela commented 8 years ago

I don't know regexp enough well to try it.

svenkreiss commented 8 years ago

Not a problem. You can try taking the error message (or some part of it) and add it in quotes: - "~/.local/bin/html5validator --root _site --ignore '<paste-error-message-here>' "

Mikaela commented 8 years ago

Thanks, that works :)

But now I have horrible mess to fix :( https://travis-ci.org/Mikaela/mikaela.github.io/builds/84625698#L244

Mikaela commented 8 years ago

What is the rule for ignoring this?

"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":4.56-4.56: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":4.61-4.61: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":4.68-4.68: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":4.74-4.74: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":5.71-5.71: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":5.76-5.76: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":5.83-5.83: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":5.89-5.89: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":7.39-7.39: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":7.44-7.44: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":7.51-7.51: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/ddg.html":7.57-7.57: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":4.84-4.84: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":4.91-4.91: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":5.99-5.99: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":5.106-5.106: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":7.67-7.67: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)
"file:/home/travis/build/Mikaela/mikaela.github.io/_site/r/tessu.html":7.74-7.74: error: “&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)

~/.local/bin/html5validator --root _site/ --ignore 'Bad value “Content-Security-Policy” for attribute “http-equiv” on element “meta”.' '“&” did not start a character reference. (“&” probably should have been escaped as “&amp;”.)' doesn't seem to work and I am not sure if that is validator error, but doing that replacing breaks the links where those go to.

They are just jekyll_redirects redirect to random place and &amp instead of & breaks the URL.

Example page: https://raw.githubusercontent.com/Mikaela/mikaela.github.io/master/r/tessu.md (that link goes to album of our dog at Facebook)

Mikaela commented 8 years ago

Solved, --blacklist r

Mikaela commented 8 years ago

Thank you for this project, finally hours later https://mikaela.info/ is valid HTML and I couldn't have ever managed it without this.

svenkreiss commented 8 years ago

I am happy this is solved.