github djlint/djLint v1.40.9

latest releases: v1.41.0, v1.40.10
one day ago

Fix

  • Indent content inside Django {% cache %}, {% timezone %}, {% localtime %} and {% localize %} blocks instead of dedenting everything after them.
  • Format django-cotton component tags such as <c-card> and <c-forms.input /> as block HTML tags without requiring custom_html configuration.
  • Preserve whitespace-only content of inline elements as a single space instead of dropping it, so runs like <b>bold</b><span> </span><i>italic</i> keep rendering a space; non-collapsible whitespace such as U+2005 is kept verbatim.
  • Preserve line breaks inside hyperscript _ attribute values, where a newline separates commands and -- comments run to the end of the line.
  • Stop inserting line breaks into attribute values that render whitespace verbatim; only class and style values are spread over multiple lines with format_attribute_template_tags.
  • Leave {% comment %} block content untouched when reformatting, e.g. bare URLs ending in />.
  • Apply rule-specific djlint:off RULE suppression to any finding overlapping the region, so reformatted guards keep linting clean.
  • Avoid false H037 reports for attribute names with a conditional template prefix, e.g. {% if x %}data-{% endif %}srcset.
  • Avoid false reports for HTML-like content inside template tag arguments, e.g. H008 on quotes in a string argument.

Don't miss a new djLint release

NewReleases is sending notifications on new releases.