From 7cfa0fa111783dd9ba88b053af5b6c577ed70062 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Wed, 23 Mar 2016 15:59:29 -0400 Subject: [PATCH] Safe template linter should use DOTALL MULTILINE has to do with how '^' and '$' behave, DOTALL will make the '.' match newlines as well. This catches several failures that were previously missed. --- scripts/safe_template_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/safe_template_linter.py b/scripts/safe_template_linter.py index 5c8d43493b..f0ffa00859 100755 --- a/scripts/safe_template_linter.py +++ b/scripts/safe_template_linter.py @@ -773,7 +773,7 @@ class UnderscoreTemplateLinter(object): end_index: The index of the end of the expression. expression: The text of the expression. """ - unescaped_expression_regex = re.compile("<%=.*?%>", re.MULTILINE) + unescaped_expression_regex = re.compile("<%=.*?%>", re.DOTALL) expressions = [] for match in unescaped_expression_regex.finditer(underscore_template):