diff --git a/codeql-queries/exclude-patterns.ql b/codeql-queries/exclude-patterns.ql index bf91c22def..62af09e667 100644 --- a/codeql-queries/exclude-patterns.ql +++ b/codeql-queries/exclude-patterns.ql @@ -5,6 +5,6 @@ import javascript from File file where (file.getExtension() = "js" or file.getExtension() = "html") - and not file.getCode().matches(".*\\{%.*%\\}.*") // Exclude Liquid code - and not file.getCode().matches(".*---.*") // Exclude YAML front matter + and not file.getCode().matches(".*\\{%-?\\s*[a-zA-Z]+.*%\\}.*") // Exclude Liquid code + and not file.getCode().matches("(?s).*---.*---.*") // Exclude YAML front matter select file