Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running node-w3c-validator throw error #3

Closed
forethoughtde opened this issue Jul 12, 2018 · 5 comments · Fixed by #8
Closed

Running node-w3c-validator throw error #3

forethoughtde opened this issue Jul 12, 2018 · 5 comments · Fixed by #8
Assignees
Labels
bug stale has no activity from reporter

Comments

@forethoughtde
Copy link

This is following error message

⠴ node-w3c-validator - processing ...undefined:1
{"messages":[{"type":"error","url":"file:/vagrant/var/export/ernaehrung_rezepte.html","lastLine":37,"lastColumn":36,"firstColumn":21,"message":"Bad value “” for attribute “action” on element “form”: Must be non-empty.","extract":"          <form action=\"\">\n     ","hiliteStart":10,"hiliteLength":16},{"type":"error","url":"file:/vagrant/var/export/ernaehrung_rezepte.html","lastLine":39,"lastColumn":68,"firstColumn":29,"message":"Any “input” descendant of a “label” element with a “for” attribute must have an ID value that matches that “for” attribute.","extract":"          <input type=\"text\" name=\"chargennummer\">\n     ","hiliteStart":10,"hiliteLength":40},{"type":"error","url":"file:/vagrant/var/export/ernaehrung_rezepte.html","lastLine":50,"lastColumn":40,"firstColumn":25,"message":"Bad value “” for attribute “action” on element “form”: Must be non-empty.","extract":"          <form action=\"\">\n     ","hiliteStart":10,"hiliteLength":16},{"type":"er

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at renderHtml (/vagrant/node_modules/node-w3c-validator/lib/render-html.js:56:22)
    at /vagrant/node_modules/node-w3c-validator/lib/validator.js:162:14
    at ChildProcess.exithandler (child_process.js:282:5)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

@OlehDutchenko
Copy link
Owner

@forethoughtde Hi!

can you attach your "ernaehrung_rezepte.html" file? for several tests

@forethoughtde
Copy link
Author

forethoughtde commented Jul 16, 2018

@dutchenkoOleg There were two problems; The first one was form element had an empty action and no method attribute and the second problem was non-exist value used in for attribute in label.

@OlehDutchenko
Copy link
Owner

Okay, I will try to reproduce this case and test

@OlehDutchenko
Copy link
Owner

@forethoughtde I tested node-w3c-validator with this markup

<form id="test-1" action="">
    <label for></label>
</form>

<form id="test-2" action>
    <label for="non-exist-1">Lorem ipsum</label>
</form>

<form id="test-3" action>
    <label for="non-exist-2">
        <input type="checkbox">
    </label>
</form>

<form id="test-4" method="get">
    <label for>
        <input type="checkbox">
    </label>
    <label for="non-exist-1">Lorem ipsum</label>
    <label for="non-exist-2">
        <input type="checkbox">
    </label>
</form>

and had no same error in process as yours.

Can you share part of your markup, in which you suppose problems?
Also, can you provide information:

  • your DOCTYPE,
  • charset of the testing document
  • and options that you used for configuration node-w3c-validator

@OlehDutchenko OlehDutchenko self-assigned this Jul 18, 2018
@OlehDutchenko OlehDutchenko added the stale has no activity from reporter label Sep 28, 2018
@OlehDutchenko
Copy link
Owner

Closed for now.
@forethoughtde feel free to re-open issue if still need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale has no activity from reporter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants