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] [Linter]Space before '=' sign following id or class thinks the value is "empty" and gives (H026) #818

Open
ssteinerx opened this issue Feb 26, 2024 · 0 comments
Labels
🔍 linter 🦠 bug Something isn't working

Comments

@ssteinerx
Copy link

ssteinerx commented Feb 26, 2024

System Info

  • OS: ubuntu 23.04
  • Python Version: 3.12.2
  • djLint Version: 1.34.1
  • template language: jinja

Issue

Empty id and class tags can be removed. (H026) is generated if there's a space between id or class and the = sign.

A space before the attribute value has no effect. The spec says "zero or more spaces" between the attribute and the = sign. The only restriction after the = is for unquoted values which may not contain a space e.g. <div id=foo> vs <div id= foo> where the second is invalid as it attempts to have a space within the id's value.

   <div id="foo"></div>  <!-- no space, no error -->
    <div id ="foo"></div> <!-- space before '=', error -->

How To Reproduce

Put the code above somewhere, run djlint on it.

Contents of .djlintrc/pyproject.toml [tool.djlint]

none

@ssteinerx ssteinerx added 🔍 linter 🦠 bug Something isn't working labels Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 linter 🦠 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant