Closed Natureshadow closed 3 years ago
Hey @Natureshadow, thank you for the detailed report!
Draft.js has nothing to do with this :) I just forgot to change that part of the issue template when setting up the repository.
Looking at your example, this looks like it might just be due to the extra li
on line 3?
{% load i18n %}
<ul class="tabs">
- <li class="tab ">
{% for section in registry.section_objects.values %}
<li class="tab">
<a class="{% if active_section == section.name %}active{% endif %}"
href="{% url registry_url section.name %}"
target="_self">
{{ section.verbose_name }}
</a>
</li>
{% endfor %}
</ul>
The parser is quite strict and will fail on templates that have mismatched start and end tags, which is usually what you want, but makes for cryptic error messages.
Oh dear. You are absolutely correct. I was focused too much on what the error explicitly said.
Sorry for the noise ;)!
Great, no problem at all.
Describe the bug
I tried curlylint on our set of Django templates, and it stumbled over some things I cannot really explain. One example is this template:
https://edugit.org/AlekSIS/official/AlekSIS-Core/-/blob/d579eec21675787347c7e7d4c2862d9d75030b0a/aleksis/core/templates/dynamic_preferences/sections.html
curlyprint complains:
It shows similar errors for other templates, but this is a very simple one.
Which terms did you search for in the documentation and issue tracker?
"parse", mainly.
Environment
I am not sure what Draft.js has to do with this, neither what relevance my browser has to do with it, as I run curlylint on the shell.
I use curlylint 0.12.0 from PyPI under Python 3.9 on Debian bullseye/sid.
Steps to reproduce
pip3 install curlylint
wget https://edugit.org/AlekSIS/official/AlekSIS-Core/-/raw/d579eec21675787347c7e7d4c2862d9d75030b0a/aleksis/core/templates/dynamic_preferences/sections.html
curlylint sections.html
Expected behavior
Template is lint-clean.
Actual behavior
curlylint throws above parse error.
Reproducible demo