Skip to content

Commit

Permalink
Fix code scanning alert no. 26: Bad HTML filtering regexp
Browse files Browse the repository at this point in the history
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
srugano and github-advanced-security[bot] authored Dec 18, 2024
1 parent 275f161 commit 6b6348b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>", "]]>"));
else return null;
} else if (stream.match("--")) {
return chain(inBlock("comment", /-->/, /--!>/));
return chain(inBlock("comment", /-->/, /--(?:!>)/));

Check failure

Code scanning / CodeQL

Bad HTML filtering regexp High

This regular expression only parses --> and not --!> as a HTML comment end tag.
} else if (stream.match("DOCTYPE", true, true)) {
stream.eatWhile(/[\w\._\-]/);
return chain(doctype(1));
Expand Down

0 comments on commit 6b6348b

Please sign in to comment.