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

bug(H006, H017): errors if violations inside comments #343

Closed
3 tasks done
Kristinita opened this issue Aug 20, 2022 · 2 comments
Closed
3 tasks done

bug(H006, H017): errors if violations inside comments #343

Kristinita opened this issue Aug 20, 2022 · 2 comments
Labels

Comments

@Kristinita
Copy link

Kristinita commented Aug 20, 2022

1. Summary

djLint linter show errors if I break the rules H006 and H017 inside comments, not in templates.

I think that inside the comments, templates creator can write whatever he wants, and djLint should look for errors as H006 and H017 in the templates, not inside the comments.

2. MCVE

2.1. File to check

  • KiraDJLint__incorrect-img-syntax-in-comments--H006-H017.html:

     {# [INFO][JINJA] I use syntax “{% if <img alt=\""”,
     if I want that something happened solely if “img” exists in the content of my articles #}
    
     <script src="KiraJS.js" defer></script>
    

2.2. Desired behavior

No errors

2.3. Current behavior

D:\SashaDebugging\KiraDJLintDebuging>djlint --profile=jinja --lint KiraDJLint__incorrect-img-syntax-in-comments--H006-H017.html

Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00


SashaDebugging\KiraDJLintDebuging\KiraDJLint__incorrect-img-syntax-in-comments--H006-H017.html
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── H006 1:37 Img tag should have height and width attributes. <img alt=\""”, if I
H017 1:37 Tag should be self closing. <img alt=\""”, if I

Linted 1 file, found 2 errors.

3. Environment

  1. Microsoft Windows [Version 10.0.19041.1415]
  2. Python 3.10.6
  3. djlint, version 1.11.0
  4. Template language — Jinja

4. Checkbox

  1. I’m on the latest version of djLint
  2. I’ve searched the issues
  3. I’ve read the docs

Thanks.

christopherpickering pushed a commit that referenced this issue Aug 22, 2022
## [1.11.1](v1.11.0...v1.11.1) (2022-08-22)

### Bug Fixes

* **formatter:** fixed runaway regex on templates with many template attriutes inside html tags ([79cd013](79cd013)), closes [#340](#340)
* **linter:** fixed false positive on T032 with jinja multi line set ([f9dac86](f9dac86)), closes [#342](#342)
* **linter:** fixed false postive on rule H008 ([79618a5](79618a5)), closes [#339](#339)
* **linter:** prevent linter matches that overlap ignored blocks of code such as comments ([90cf576](90cf576)), closes [#343](#343)
@christopherpickering
Copy link
Contributor

🎉 This issue has been resolved in version 1.11.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Kristinita
Copy link
Author

Status: FIXED ✔️ for me for djLint 1.11.1.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants