Lexer fails to tokenize multi-line template tags
Lexer fails to tokenize multi-line template tags
Reduced test-case
<%
%>
We have included the minimal code in the test case, but it is actually because we want to write the following code in the EJS template.
<%_
const a = '';
_%>
Expected result
No error
Actual result
failed to tokenize "<%\r\n%> ", state TEXT failed to consume data or change state parser-error
The following code is expected to fix the problem.
src/lexer/lexer.ts
-18: <%.*?%>
+18: <%[\s\S]*?%>
src/rules/no-raw-characters.ts
-16: <%.*?%>
+16: <%[\s\S]*?%>
I tried to fork it and modify only the above diffs in my repository, but for some reason the test failed and I couldn't push it to the repository, so is it possible to import this modification?
Version
-
html-validate
: 6.0.2