Coder Social home page Coder Social logo

Comments (6)

Lucas-C avatar Lucas-C commented on July 30, 2024 1

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.

Lucas-C avatar Lucas-C commented on July 30, 2024

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.

Lucas-C avatar Lucas-C commented on July 30, 2024

Some more findings:

  • the error only show up when the path to vnu.jar passed to java -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.

Lucas-C avatar Lucas-C commented on July 30, 2024

I submitted a PR with a suggestion for fix.
I tested it, it fixes my initial issue.

from html5validator.

lorvent avatar lorvent commented on July 30, 2024

@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.

lorvent avatar lorvent commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.