svenkreiss / html5validator Goto Github PK
View Code? Open in Web Editor NEWCommand line tool to validate HTML5 files. Great for continuous integration.
License: MIT License
Command line tool to validate HTML5 files. Great for continuous integration.
License: MIT License
This is the first time I'm submitting an issue on this repo. Apologies if I am missing something below.
I am receiving the following validation flag when I run the tool:
Bad value "doc-endnote" for attribute "role" on element "li".
There was a bug in w3/epubcheck that caused this error. This attribute was allowed on child <li>
elements of a <ul>
but not an <ol>
. As far as I can tell, this has been fixed.
Am I misusing the html5validator tool or is this a bug?
Please consider adding an option to list HTML files.
Hi, I am working on a website, and I realized, this app doesn' t recognize
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
I get:
error: Bad value “X-UA-Compatible” for attribute “http-equiv” on element “meta”.
but If validate the same page in:
https://html5.validator.nu/
it passes without warnings, which makes me assume that this project is running on an older version of the validator. if so, could it be possible to update it and release a new pip package.
I' m trying to integrate elixir-lang.org (https://github.com/elixir-lang/elixir-lang.github.com/) on travis, and I won' t be able to until this little issue is solve.
let me know if you need more input from my side,
thanks a lot, I use your project a lot to validate this website (but for the time being just locally)
cheers
When I try to validate this CSS:
:not(p, a)
{
color: red;
}
Html5validator gives me:
"file:<path>/example.css":1.6-1.6: error: CSS: Parse Error.
"file:<path>/example.css":4.2-5.1: error: CSS: Parse Error.
V.Nu’s Web interface reports no errors with that CSS.
The CLI return value indicates the number of validation errors. When it hits 256 errors, it wraps modulo 256 and returns 0, indicating no errors. Patch to follow.
It would be really nice to be able to check documents and obtain the error/warning messages programmatically.
Currently, the function 'Validator.validate' simply dumps the output to the logger, and returns an integer indicating whether any errors were detected.
At a very basic level, it would be nice to simply have a function that invokes vnu.jar and returns its output as a string or a list of strings.
A nicer interface would be to invoke vnu.jar in "json" mode and parse the output into a Python dictionary.
Would you be open to adding such an API?
Hello!
html5validator was working but now
WARNING:html5validator.validator:Exception in thread "main" java.lang.UnsupportedClassVersionError: nu/validator/client/SimpleCommandLineValidator : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Build log: https://travis-ci.org/szepeviktor/ip-info/builds/126924244#L140
Travis config: https://github.com/szepeviktor/ip-info/blob/gh-pages/.travis.yml
When you install html5validator but not java, and try to execute html5validator --root <some_path>
it will throw: OSError: [Errno 2] No such file or directory
Which is not telling what the real problem is
The full stack trace is:
Traceback (most recent call last):
File "/usr/bin/html5validator", line 9, in <module>
load_entry_point('html5validator==0.2.8', 'console_scripts', 'html5validator')()
File "/usr/lib/python2.7/site-packages/html5validator/cli.py", line 72, in main
stack_size=args.stack_size,
File "/usr/lib/python2.7/site-packages/html5validator/validator.py", line 94, in validate
stdout=f_null, stderr=f_null) != 0:
File "/usr/lib64/python2.7/subprocess.py", line 524, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
when calling this fine validator with the option --format json the return value will always be not 0. This is a problem, when I am trying to use this in a gitlab-ci pipeline, as it fails when any script is not exited with return value 0.
If I run html5validator
(installed with pip in a virtualenv on Debian 11) against a dummy HTML file:
mkdir -p qq
cat > qq/index.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
</body>
</html>
^d
html5validator --root qq/ --also-check-css --format text --log INFO
returns:
INFO:html5validator.cli:Files to validate:
qq/index.html
INFO:html5validator.cli:Number of files: 1
INFO:html5validator.validator:All good.
and echo $?
yields 0.
But if I add <div x-data="stationsMap"></div>
inside the body and --ignore-re ".*Attribute .x-.* not allowed on element.*"
to the comand line to ignore the x-data
attribute it returns:
INFO:html5validator.cli:Files to validate:
qq/index.html
INFO:html5validator.cli:Number of files: 1
From line 6, column 5; to line 6, column 30 in resource file:/tmp/qq/index.html
Document checking completed.
but echo $?
yields 2.
Also reproducible with docker run --rm -it -v "$PWD/qq:/qq" cyb3rjak3/html5validator:latest-alpine html5validator --root /qq/ --also-check-css --format text --ignore-re ".*Attribute .x-.* not allowed on element.*" --log INFO
Thanks!
JSON output currently is broken because the "smart quotes" option cannot be switched off (--asciiquotes). This means that the "message" value can contain normal double quotes, which breaks JSON parsers.
The latest release at https://github.com/validator/validator/releases/tag/jar fixes this.
Looking through the test it appears that the test test_json_parseable
is never called. It does pass
The program is only available in English.
I suggest to add --also-check-css
parameter to the "usage" and "optional arguments" sections. At this moment the parameter is only mentioned in the --math
option description:
$ html5validator --help
usage: html5validator [-h] [--root ROOT] [--match MATCH [MATCH ...]] [--blacklist [BLACKLIST [BLACKLIST ...]]] [--show-warnings] [--no-langdetect] [--format {gnu,xml,json,text}]
[--ignore [IGNORE [IGNORE ...]]] [--ignore-re [IGNORE_RE [IGNORE_RE ...]]] [-l] [-ll] [-lll] [--log LOG] [--version]
[files [files ...]]
[v0.3.3] Command line tool for HTML5 validation. Return code is 0 for valid HTML5. Arguments that are unknown to html5validator are passed as arguments to `vnu.jar`.
positional arguments:
files specify files to check
optional arguments:
-h, --help show this help message and exit
--root ROOT start directory to search for files to validate
--match MATCH [MATCH ...]
match file pattern in search (default: "*.html" or "*.html *.css" if --also-check-css is used)
--blacklist [BLACKLIST [BLACKLIST ...]]
directory names to skip in search
--show-warnings show warnings and count them as errors
--no-langdetect disable language detection
--format {gnu,xml,json,text}
output format
--ignore [IGNORE [IGNORE ...]]
ignore messages containing the given strings
--ignore-re [IGNORE_RE [IGNORE_RE ...]]
regular expression of messages to ignore
-l run on larger files: sets Java stack size to 2048k
-ll run on larger files: sets Java stack size to 8192k
-lll run on larger files: sets Java stack size to 32768k
--log LOG log level: DEBUG, INFO or WARNING (default: WARNING)
--version show program's version number and exit
$ html5validator --version
html5validator 0.3.3
<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.
AFAIU, localcrawl
can't validate HTML on the fly, it just writes files and I can use wget
as well for this. But all I want to do is to check a list of URLs on localhost, do I absolutely have to designate a filename for them with some wrapper script?
Same issues as #52. I solved it for --format text and gnu but it still happens for JSON and XML.
Both JSON and XML come back with an error field that says it found no errors. Fix and test in progress.
The following false positives are thrown:
error: CSS: "text-decoration-skip-ink": Property "text-decoration-skip-ink" doesn't exist.
error: CSS: "color-adjust": Property "color-adjust" doesn't exist.
error: CSS: "overflow-anchor": Property "overflow-anchor" doesn't exist.
But those are valid CSS:
If it's an external library that is responsible for those tests, please advice where to address this to 🙂.
I see that 0.27 version has started to report the following warnings:
WARNING:html5validator.validator:"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/403.html":1.16-5.73: info warning: This document appears to be written in Danish but the "html" start tag has "lang="en"". Consider using "lang="da"" (or variant) instead.
"file:/home/travis/build/php-coder/mystamps/src/main/webapp/WEB-INF/views/error/500.html":1.16-5.73: info warning: This document appears to be written in Danish but the "html" start tag has "lang="en"". Consider using "lang="da"" (or variant) instead.
Here are these files:
Hi,
The idea would be to remove {{mustaches}}
in each HTML file before passing them to v.Nu.
Would you be open to the addition of such feature ?
I can send you a PR with a 1st implementation.
Good morning!
Is Found files to validate: 1
the expected output?
Does it mean that it is valid??
https://travis-ci.org/szepeviktor/ip-info/builds/82826416#L95
Would it be possible to include this in the readme?
Thank you!
Recently TravisCI added export _JAVA_OPTIONS="-Xmx2048m -Xms512m"
to their environment and my tests started to fail because html5validator is showing warning for that:
$ export _JAVA_OPTIONS="-Xmx2048m -Xms512m"
$ html5validator --root src/main/webapp/WEB-INF/views
WARNING:html5validator.validator:Picked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
$ echo rc=$?
rc=1
While I'm able to ignore it with --ignore-re
I believe that this is a bug and should be fixed.
Hi there, the maintainer of https://github.com/validator/validator, which this depends on, just added an option to the validator to output the HTML warnings & HTML errors to stdout, while leaving stderr free for exceptional cases (exceptions, error messages that are unrelated to the HTML).
You might consider switching to setting --stdout
, and reading from the stdout stream rather than the stderr stream. This would save you having to filter out errors from the stream like Picked up _JAVA_OPTIONS:
here: https://github.com/svenkreiss/html5validator/blob/master/html5validator/validator.py#L17.
I have yet to properly investigate this but it seems that this latest release might be causing (some?) --ignore
directives to be, well, ignored.
See this Circle Build https://circleci.com/gh/betagouv/beta.gouv.fr/4323
The JSON/XML output can't be parsed by other tools (like jq
) because it's invalid:
$ html5validator --root src/main/webapp/WEB-INF/views --format json 2>&1 | jq
parse error: Invalid numeric literal at line 1, column 6
Example of JSON output:
ERROR:html5validator.validator:['{"messages":[ ... ]}']
Example of XML output (it looks like XML within JSON):
ERROR:html5validator.validator:["<?xml version='1.0' encoding='utf-8'?>", '<messages xmlns="http://n.validator.nu/messages/">'
Another small improvement that would be nice to have, is to show output on stdout, so it can be piped to other utils. At this moment, I have to redirect stderr to stdout in order to process it:
$ html5validator --root src/main/webapp/WEB-INF/views --format json 2>&1 | less
When building html5validator on CentOS 6.5 using 'python setup.py install', executing the html5validator
resulted in the following error:
html5validator --root tests/multiple_ignores/ --ignore-re 'Attribute "ng-[a-z-]+" not allowed' 'Start tag seen without seeing a doctype first'
Traceback (most recent call last):
File "/usr/bin/html5validator", line 9, in <module>
load_entry_point('html5validator==0.2.1', 'console_scripts', 'html5validator')()
File "/usr/lib/python2.6/site-packages/html5validator-0.2.1-py2.6.egg/html5validator/cli.py", line 69, in main
stack-size=args.stack-size,
File "/usr/lib/python2.6/site-packages/html5validator-0.2.1-py2.6.egg/html5validator/validator.py", line 84, in validate
o = subprocess.check_output(['java', '-jar',
AttributeError: 'module' object has no attribute 'check_output'
$
I've got the following installed:
java version "1.7.0_91"
OpenJDK Runtime Environment (rhel-2.6.2.2.el6_7-x86-64 u91-b000)
penJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
Python 2.6.6
I'd particularly like one that includes 67ecbc0
I seem to have found an edge case where if the --root
option is set to a folder that doesn't exist then the default help text is displayed for vnujar
.
Example:
> html5validator --root INVALID --log DEBUG
INFO:html5validator.cli:Files to validate:
INFO:html5validator.cli:Number of files: 0
DEBUG:html5validator.validator:['java', '-jar', '/home/j/.local/lib/python3.6/site-packages/vnujar/vnu.jar', '--errors-only', '--stdout', '--asciiquotes']
DEBUG:html5validator.validator:['Error: No documents specified.', 'Usage:', ' vnu-runtime-image/bin/vnu OPTIONS FILES (Linux or macOS)', ' vnu-runtime-image\\bin\\vnu.bat OPTIONS FILES (Windows)', ' java -jar ~/vnu.jar OPTIONS FILES (any system with Java8+ installed)', '...where FILES are the documents to check, and OPTIONS are zero or more of:', ' --errors-only --Werror --exit-zero-always --stdout --asciiquotes', ' --user-agent\xa0USER_AGENT --no-langdetect --no-stream --filterfile\xa0FILENAME', ' --filterpattern\xa0PATTERN --css --skip-non-css --also-check-css --svg', ' --skip-non-svg --also-check-svg --html --skip-non-html', ' --format\xa0gnu|xml|json|text --help --verbose --version', 'For detailed usage information, try the "--help" option or see:', ' http://validator.github.io/', 'To read from stdin, use "-" as the filename, like this: "java -jar vnu.jar - ".', 'To run the checker as a standalone Web-based service, open a new terminal', 'window and invoke the checker like this', ' java -cp vnu.jar nu.validator.servlet.Main 8888', ' vnu-runtime-image/bin/java nu.validator.servlet.Main 8888', ' vnu-runtime-image\\bin\\java -cp vnu.jar nu.validator.servlet.Main 8888', '...then open http://127.0.0.1:8888 in a browser.', 'After that, to check documents locally using the packaged HTTP client, do this:', ' java -cp vnu.jar nu.validator.client.HttpClient FILES', ' vnu-runtime-image/bin/java nu.validator.client.HttpClient FILES', ' vnu-runtime-image\\bin\\java nu.validator.client.HttpClient FILES']
Error: No documents specified.
Usage:
vnu-runtime-image/bin/vnu OPTIONS FILES (Linux or macOS)
vnu-runtime-image\bin\vnu.bat OPTIONS FILES (Windows)
java -jar ~/vnu.jar OPTIONS FILES (any system with Java8+ installed)
...where FILES are the documents to check, and OPTIONS are zero or more of:
--errors-only --Werror --exit-zero-always --stdout --asciiquotes
--user-agent USER_AGENT --no-langdetect --no-stream --filterfile FILENAME
--filterpattern PATTERN --css --skip-non-css --also-check-css --svg
--skip-non-svg --also-check-svg --html --skip-non-html
--format gnu|xml|json|text --help --verbose --version
For detailed usage information, try the "--help" option or see:
http://validator.github.io/
To read from stdin, use "-" as the filename, like this: "java -jar vnu.jar - ".
To run the checker as a standalone Web-based service, open a new terminal
window and invoke the checker like this
java -cp vnu.jar nu.validator.servlet.Main 8888
vnu-runtime-image/bin/java nu.validator.servlet.Main 8888
vnu-runtime-image\bin\java -cp vnu.jar nu.validator.servlet.Main 8888
...then open http://127.0.0.1:8888 in a browser.
After that, to check documents locally using the packaged HTTP client, do this:
java -cp vnu.jar nu.validator.client.HttpClient FILES
vnu-runtime-image/bin/java nu.validator.client.HttpClient FILES
vnu-runtime-image\bin\java nu.validator.client.HttpClient FILES
> echo $?
24
I'm not sure the best way to solve this and if we even should (See edit).
My best way would be to check if root
exists?
Edit: I do believe that this should be fixed as it is being detected that there are no files to validate but it still continues to run.
I've been running into an issue occasionally while running it, getting this error:
$ html5validator --root _site/
WARNING:html5validator.validator:StackOverflowError while evaluating HTML schema.
The checker requires a java thread stack size of at least 512k.
Consider invoking java with the -Xss option. For example:
java -Xss512k -jar ~/vnu.jar FILE.html
One of the systems I've been getting this bug on is a bad little notebook with not-that-much RAM, but the other is a MBP with 16GB of RAM. Figured I'd ask and see if you've seen this before :)
Thanks for the awesome and useful tool!
edit: Hmm, upping the call to use -Xss2048k
as recommended did work. Maybe it'd be nice to allow for these sort of higher limits as a command-line option or something?
os.errno
has been removed since Python 3.7, but it's still being used in validator.py
:
html5validator/html5validator/validator.py
Line 154 in 81fbe36
This causes the validator to crash with the following error message instead of notifying the user that Java is missing.
AttributeError: module 'os' has no attribute 'errno'
There is no note of a java runtime environment required nor is it tested for so if you don't have one all you get to see is the message "===> Not HTML5 compatible." which is bogus.
13:48 $ html5validator --root .
ERROR:html5validator.validator:StackOverflowError while evaluating HTML schema.
The checker requires a java thread stack size of at least 512k.
Consider invoking java with the -Xss option. For example:
java -Xss512k -jar ~/vnu.jar FILE.html
Using Uruk GNU/Linux 2.0 (32bit) on a Lenovo X60. Is there a way I can invoke Java that way from html5validator and solve my issue?
Hi, I keep getting the message "93.11-93.11: error: CSS: Parse Error"
I now this relates to html line 93 postion 11.
that line looks like:
.highlight .hll{background-color:#373b41}
view-source:https://tedxamstelveen.com/
my html5 looks like:
is there a option to get more info on the "CSS: Parse Error"?
or would there be a new option to disable css validation tmp
thanx.
Hi, I am trying to use html5validator in my tests by listing it in my setup.py file.
tests_require=[
'pytest >=5.0',
'pytest-cov',
'behave >=1.2',
'html5validator >=0.3.1',
]
However, I get the following failure:
The HTML pages are in ../tmp/pytest-of-root/pytest-0/test_html5_is_valid0/html.
Validating HTML for ['/tmp/pytest-of-root/pytest-0/test_html5_is_valid0/html/index.html']
----------------------------------------------------------- Captured stderr call -----------------------------------------------------------
WARNING: html_static_path entry '_static' does not exist
------------------------------------------------------------ Captured log call -------------------------------------------------------------
ERROR html5validator.validator:validator.py:151 Error: Unable to access jarfile /src/.eggs/html5validator-0.3.1-py3.7.egg/vnujar/vnu.jar
============================================================= warnings summary =============================================================
A quick check shows that .eggs/html5validator-0.3.1-py3.7.egg
is a compressed zip file, instead of a directory.
Note that this problem is not visible when using pip instead of easy_install, as pip always unpacks dependencies.
Please either list the .jar file among the eager_resources
in setup.py
, or specify zip_safe=False
in setup.py
. That should ensure it is always uncompressed.
I think I'm missing something maybe escaping or something but I try to use:
html5validator index.html --ignore-re "^CSS: "
or
html5validator index.html --ignore-re "/^CSS: /"
to filter out messages like:
CSS: 'margin-block-end': Property 'margin-block-end' doesn't exist.
But both seems not to work I know something like CSS:
works but that would also filter out messages when CSS:
would be part of that message and not the start of the message. Maybe I just miss how I need to escape ^
correctly.
Can you please provide documentation on the CONFIG FILE
option in the README.MD
file?
Ideally, there would be a list of options that can be placed in the config file, along with the correct syntax and file format for the config file.
If this config file is specifically for validator.nu, and there is good documentation provided by that project, then provide a link to said documentation.
if the CONFIG FILE
option is deprecated or non-functional, then provide a warning to that effect.
Thank you
Pypi latest version of this package is v0.2.10, but there is no matching tag in GitHub,
nor a mention of it in the README Changelog.
Sadly this version broke my pre-commit
hook using it :(
Indeed, Validator.validate
does not accept anymore the errors_only
nor stack_size
parameter.
Can I validate CSS with this tool? I would like to validate all html and css files. From the Nu HTML Checker's Documentation I see that I should be able to do that with the flag --also-check-css
, but html5validator doesn't seem to support it. Any other way? Can I use directly HTML Checker?
Hello,
I'm trying to write a pre-commit hook to do some HTML validation using your lib:
Lucas-C/pre-commit-hooks@2916a99
However I'm facing this error when using html5validator.validator.Validator
:
Error: Unable to access jarfile /home/lucas_cimon/.pre-commit/repor9ky908h/py_env-default/lib/python3.4/site-packages/vnujar/vnu.jar
I replicated this issue by invoking the command directly:
$ java -jar /home/lucas_cimon/.pre-commit/repor9ky908h/py_env-default/lib/python3.4/site-packages/vnujar/vnu.jar vignette.hbs
Error: Unable to access jarfile /home/lucas_cimon/.pre-commit/repor9ky908h/py_env-default/lib/python3.4/site-packages/vnujar/vnu.jar
Note that I'm working under Windows with Cygwin.
A StackOverflow answer to this issue suggested to move the jar in my current directory, and it does work when I invoke it manually:
$ java -jar vnu.jar vignette.hbs "file:/G:.../vignette.hbs":1.1-2.72: error: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
"file:/G:/.../vignette.hbs":1.1-2.72: error: Element “head” is missing a required instance of child element “title”.
"file:/G:/.../vignette.hbs":1.1-2.72: error: Bad value “{{offer.url}}” for attribute “href” on element “a”: Illegal character in path segment: “{” is not allowed.
"file:/G:/.../vignette.hbs":5.9-5.66: error: Bad value “{{imgSrc}}” for attribute “src” on element “img”: Illegal character in path segment: “{” is not allowed.
Would you have any explanation for this strange problem ?
I'm going to try to modify html5validator/validator.py
locally to change the current directory before the .jar
invocation.
Right now the validator doesn't complain when img tags are missing the alt attribute.
Expected behavior:
Exactly like the W3C validator there should be an error or at least warning when the alt attribute is missing.
https://github.com/svenkreiss/html5validator/blob/master/html5validator/cli.py#L25
--show-warnings
gets stored into args.error_only
.
Starting from version 0.1.12 I get the following error, version 0.1.11 works fine. It is related to this commit: 647ad91
html5validator --root build/html/
Found files to validate: 180
Traceback (most recent call last):
File "/usr/local/bin/html5validator", line 9, in <module>
load_entry_point('html5validator==0.1.12', 'console_scripts', 'html5validator')()
File "/usr/local/lib/python2.7/dist-packages/html5validator/cli.py", line 28, in main
sys.exit(v.validate(files, errors_only=args.error_only))
File "/usr/local/lib/python2.7/dist-packages/html5validator/validator.py", line 79, in validate
print(b'\n'.join(o).decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 164: ordinal not in range(128)
I did set locale information to try to avoid the issue but it didn't help.
python --version
Python 2.7.6
# set locale
export LC_ALL=de_DE.UTF-8
export LANG=de_DE.UTF-8
export LANGUAGE=de_DE.UTF-8
locale
LANG=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8
I tried to use --format json --ignore "Some Text"
ends in 0 errors when finding one error to ignore.
If there is no error for which matches --ignore or --ignore-re the result is like expected. But if there is just 1 error message matching the json
result is 0. Without all works like expected. So it seems only be a problem with json result. All other formats like text
, gnu
or xml
are correctly returned.
After updating to 0.2.1 --ignore
option gets ignored.
I'm invoking htmlvalidator with the following command: html5validator --root src/main/webapp/WEB-INF/views --ignore 'Attribute “(th|sec|togglz|xmlns):[a-z]+” not allowed' 'Attribute “(th|sec|togglz):[a-z]+” is not serializable' 'Attribute with the local name “xmlns:[a-z]+” is not serializable' --show-warnings
any runtime error caused by the java runtime tells people "===> Not HTML5 compatible." while this is may me entirely untrue.
eg.
in a site directory with 50 html pages:
html5validator --root .\_site --show-warnings
===> Not HTML5 compatible.
but running on a non-existent directory
html5validator --root C:\_site --show-warnings
===> Not HTML5 compatible.
In the PR #39 you exposed a couple options and also updated vnu.jar to a new version that has useful --Werror
option. Could it be exposed to html5validator?
I'm surprised that it's not enabled by default...
In Integration with TravisCI
chapter I see the example of .travis.yml
that is using pip install html5validator
command, but it fails with "permission denied" error. In this case we should use --user
option: http://stackoverflow.com/questions/27036259/how-to-write-travis-yml-if-my-project-deps-on-python-and-nodejs
Probably, it also affects old-style builds, that don't use the docker infrastructure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.