'Error: Unknown combinator "-"' with "a - b" in for attribute
If there's a hyphen wrapped in spaces inside a for
attribute (possibly others too) then validation fails with 'Error: Unknown combinator "-"'
Reduced test-case
Run html-validate "combinator.html" -f stylish
with the following input to see the error:
<html>
<body>
<label for="a - b">
</body>
</html>
The following works:
<html>
<body>
<label for="a-b">
</body>
</html>
Configuration
Defaults, no config file:
Expected result
No crash :).
Actual result
Validator crashed when parsing "combinator.html"
Caught exception:
Error: Unknown combinator "-"
at parseCombinator (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:766:19)
at new Pattern (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:892:27)
at C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:953:38
at Array.map (<anonymous>)
at Function.parse (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:953:24)
at new Selector (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:922:33)
at HtmlElement.querySelectorImpl (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:1380:29)
at querySelectorImpl.next (<anonymous>)
at HtmlElement.querySelector (C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:1368:19)
at C:\Users\lehoc\AppData\Roaming\npm\node_modules\html-validate\dist\cjs\core.js:4790:36
This is a bug in html-validate-5.1.1.
Please file a bug at https://gitlab.com/html-validate/html-validate/issues/new?issuable_template=Bug
and include this message in full and if possible the content of the
file being parsed (or a reduced testcase).
Version
-
html-validate
: 5.1.1 -
html-validate-angular
: not used -
html-validate-vue
: not used -
html-validate-protractor
: not used . any other relevant plugin: not used