thibaudcolas / curlylint

Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid
https://www.curlylint.org/
MIT License
236 stars 25 forks source link

Parsing fails for {% comment %} including number within HTML tag #143

Open vekerdyb opened 1 year ago

vekerdyb commented 1 year ago

Describe the bug

Parsing fails for {% comment %} including number within HTML tag.

Environment

OSX 12.6

Python 3.10.6

curlylint 0.13.1

Steps to reproduce

  1. Create the template:
    <div
        {% comment %}
            1
        {% endcomment %}
    ></div> 
  2. Then, run curlylint on it

Expected behavior

Should pass, similarly to this version, without a number (which passes as expected):

<div
    {% comment %}
        A
    {% endcomment %}
></div> 

Actual behavior

Fails with:

$ curlylint --verbose /project/template.html
Identified project root as: /project
Analyzing file content from stdin
Files being analyzed:
/project/template.html
/project/template.html
2:8     Parse error: expected one of '>', 'attribute', '{#', '{%', '{{' at 2:8  parse_error