diff --git a/django/template/base.py b/django/template/base.py index a3182ea7044..2f30d5fe7a3 100644 --- a/django/template/base.py +++ b/django/template/base.py @@ -354,10 +354,10 @@ class Lexer: in_tag = False lineno = 1 result = [] - for bit in tag_re.split(self.template_string): - if bit: - result.append(self.create_token(bit, None, lineno, in_tag)) - lineno += bit.count('\n') + for token_string in tag_re.split(self.template_string): + if token_string: + result.append(self.create_token(token_string, None, lineno, in_tag)) + lineno += token_string.count('\n') in_tag = not in_tag return result