Merge pull request #15879 from edx/ret/mako-template-comments
Teach the mako template linter to understand django-format comments
This commit is contained in:
@@ -578,6 +578,7 @@ class TestMakoTemplateLinter(TestLinter):
|
||||
@data(
|
||||
{'template': '{% extends "wiki/base.html" %}'},
|
||||
{'template': '{{ message }}'},
|
||||
{'template': '{# comment #}'},
|
||||
)
|
||||
def test_check_mako_on_django_template(self, data):
|
||||
"""
|
||||
|
||||
@@ -2003,7 +2003,7 @@ class MakoTemplateLinter(BaseLinter):
|
||||
True if this is really a Django template, and False otherwise.
|
||||
|
||||
"""
|
||||
if re.search('({%.*%})|({{.*}})', mako_template) is not None:
|
||||
if re.search('({%.*%})|({{.*}})|({#.*#})', mako_template) is not None:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user