Open LightCC opened 4 years ago
alternatively, to support other types of files, (I'm using nunjucks templates with my eleventy SSG site), can the configuration for htmlhint be configured to use different htmlhint rc files for different file extensions?
in the meantime, I've just posted a feature request with the upstream htmlhint project asking if the .htmlhintrc syntax be extended to overide rules for different file extensions, and define start/end pairs like "{{", "}}" and "{%", "%}" so that stuff between them can be ignored.
Related to: https://github.com/htmlhint/HTMLHint/issues/492
I too am facing this issue, although I feel this must be implemented in the npm package than in the VS Code extension.
Possible solution: https://github.com/htmlhint/HTMLHint/issues/492#issuecomment-808464837
please how can i disable the spec-char-escape
It appears that EJS (Embedded JavaScript) files could be supported pretty easily on this extension.
EJS templates embedded javascript with
<%
begin tags and%>
end tags, with javascript and other characters that drive various behavior inbetween the ejs start/stop tags.Currently, htmlhint gives the following error on these tags:![image](https://user-images.githubusercontent.com/19731713/87215833-616e6180-c308-11ea-94d8-f8cf38969d6e.png)
So, one can work around this by turning off the
spec-char-escape
rule, but then the rule won't catch any non-ejs issues with special character escaping.The following should be considered for ejs files (*.ejs) by default, or allow explicit configuration by user somehow. These are considered as least support for ejs to most support (but also least amount of work to most amount of work):
spec-char-escape
rule only on<%
and%>
<%
and%>
tags and ignore both the tags and everything between them<%
,<%=
, etc.)