Comments (6)
I implemented various strategies to remove mustaches in my git pre-commit
hook:
https://github.com/Lucas-C/pre-commit-hooks-java/blob/master/pre_commit_hooks/validate_html.py#L33
from html5validator.
Nope.
Adding a os.chdir(os.path.dirname(self.vnu_jar_location))
before line 83 did not change a thing:
https://github.com/svenkreiss/html5validator/blob/master/html5validator/validator.py#L83
from html5validator.
Some more findings:
- the error only show up when the path to
vnu.jar
passed tojava -jar
is an absolute one - if the path to the checked HTML is absolute, the validation will fail silently
In Cygwin, converting the absolute Unix paths to Windows ones fixes the problem:
$ java -jar "$(cygpath -w /home/lucas_cimon/.pre-commit/repor9ky908h/py_env-default/lib/python3.4/site-packages/vnujar/vnu.jar)" "$(cygpath -w /home/lucas_cimon/vignette.hbs)"
from html5validator.
I submitted a PR with a suggestion for fix.
I tested it, it fixes my initial issue.
from html5validator.
@Lucas-C can you tell me how did you fix
"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.
i use template engines so it is throwing same error to me aswell.
from html5validator.
ok....
I use laravel with blade syntax, so finally i had to use it like this
- html5validator --root resources/views/ --match "*.blade.php" --blacklist node_modules vendors src --ignore-re 'Bad value "{{\s?asset|route|url(.*?)\s?}}" for attribute "href|src" on element "link|script|img|a"' 'Bad value "{{\s?asset|route|url(.*?)\s?}}" for attribute "action" on element "form"' 'Bad value "{{\s?URL::to(.*?)\s?}}" for attribute "action" on element "form"' 'Non-space characters found without seeing a doctype first. Expected "<!DOCTYPE html>"' 'Element "head" is missing a required instance of child element "title"'
from html5validator.
Related Issues (20)
- The `vnujar` should be updated HOT 2
- add missing CSS Property "text-decoration-thickness"
- [Feature Request] Programmatic integration with Selenium Webdriver HOT 1
- break dependency on outdated log4j
- CSS: Doesn't know color-schema
- Report info isssues
- Numerous vulnerabilities in package from PyPI HOT 1
- Can we get a new pip release please? HOT 5
- Consider using --stdout option to vnu.jar HOT 4
- Bad value "doc-endnote" for attribute "role" on element "li".
- [CSS] False positives HOT 3
- Show --also-check-css parameter in --help output HOT 1
- Make the json/xml output parseable by other tools HOT 1
- Documentation of config file HOT 1
- AttributeError: module 'os' has no attribute 'errno' HOT 1
- HTML5validator exits with return code 24 when invalid root given
- JSON parseable test is never run
- --ignore flag works but the return code is nonzero HOT 2
- Unable to use ignore-re with start regex "^"
- The "--format json" and "--ignore" not working together
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html5validator.