Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off-by-one error in error reporting after comment #18

Closed
sjoerdjob opened this issue May 19, 2021 · 0 comments
Closed

Off-by-one error in error reporting after comment #18

sjoerdjob opened this issue May 19, 2021 · 0 comments

Comments

@sjoerdjob
Copy link
Contributor

Using the 4-line excerpt

{% comment %}
This is some text
{% endcomment %}
</li>

the output is

found closing “</li>” on line 5 that was never opened.

but should have been

found closing “</li>” on line 4 that was never opened.
sjoerdjob added a commit to sjoerdjob/djhtml that referenced this issue May 19, 2021
sjoerdjob added a commit to sjoerdjob/djhtml that referenced this issue May 19, 2021
JaapJoris added a commit that referenced this issue May 23, 2021
This commit brings a BIG update to the tokenization algorithm: instead of
creating "recursive" tokens, the complete tokenization of all of the source
text now happens iteratively in a single loop. The nifty `--debug` command
line option lets you inspect how the input is tokenized.

The new algorithm reduces the complexity of the modes to just a single
`create_token()` method, solves the line numbering problem (#18), and solves
various incorrect tokenization issues (such as #20).

I would like to thank my former professor J.J. Paijmans for teaching me the
knowledge required to pull of this feat. Thanks Paai!

Besides this, a new mode `InsideHTMLTag` was added to allow for different
rules within HTML tags than outside of it. This means that multiline html
tags are now tokenized and parsed correctly.

Finally, the list of Django block tags is gone and they are now recognized
by looking ahead for end tags, which eliminates the need for a configuration
option to register custom template tags (#16).

Closes #16
Closes #18 (again)
Closes #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant