Skip to content

Commit

Permalink
Recursive tokens report 1 more line than they should.
Browse files Browse the repository at this point in the history
Fixes #18.
  • Loading branch information
sjoerdjob committed May 19, 2021
1 parent 170afd2 commit 89c07d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions djhtml/modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def tokenize(self, tabwidth):
elif token:
line.append(token)
line_nr += token.text.count("\n")
if token.recursive:
# Recursive tokens report 1 more line than they should.
line_nr -= 1

# At the end of my money, I always have a little bit of month
# left over - Loesje
Expand Down
7 changes: 7 additions & 0 deletions tests/suite/error_after_comment.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{% comment %}
This is some text
{% endcomment %}
{% comment %}
This is some text
{% endcomment %}
<style>
a {
}
</style>
</li>

0 comments on commit 89c07d7

Please sign in to comment.