Skip to content

[FEATURE] The indent setting to apply for wrapped HTML attributes.  #1877

@mraksdev

Description

@mraksdev

Feature Request

Description

Currently, the indent configuration option in pyproject.toml (or djlint.toml) correctly sets the indentation level for nested HTML tags. However, it does not control the indentation level for wrapped attributes within a single HTML tag. Wrapped attributes are always indented with a fixed value of 4 spaces, regardless of the indent setting.

Expected Behavior

The indent setting should apply consistently to all indentation, including wrapped HTML attributes. Or add a setting for wrapped HTML attributes

If I set indent = 2 in my configuration, I expect the following output:

Desired output:

<link
  rel="apple-touch-icon"
  sizes="180x180"
  href="{% static "img/fav/apple-touch-icon.png" %}"
/>

Actual Behavior

<link rel="apple-touch-icon"
      sizes="180x180"
      href="{% static " img/fav/apple-touch-icon.png" %}">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions