diff --git a/tools/check-templates b/tools/check-templates index 3dfe020354..aa5fae8cbc 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -85,59 +85,76 @@ def validate(fn, check_indent=True): # type: (str) -> bool return text[state.i:state.i+len(s)] == s + def looking_at_html_start(): + # type: () -> bool + return looking_at("<") and not looking_at(" bool + return looking_at(" bool + return looking_at("{{#") or looking_at("{{^") + + def looking_at_handlebars_end(): + # type: () -> bool + return looking_at("{{/") + + def looking_at_django_start(): + # type: () -> bool + return looking_at("{% ") and not looking_at("{% end") + + def looking_at_django_end(): + # type: () -> bool + return looking_at("{% end") + + def special_html_tag(s, tag): + # type: (str, str) -> bool + return (s.startswith('