Skip to content

Commit 3f843bb

Browse files
committed
docs: condense the unreleased changelog
1 parent e864bf6 commit 3f843bb

1 file changed

Lines changed: 14 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,23 @@
66

77
### Feature
88

9-
- New `--stdin-filename` option tells djLint the real path of content piped in on stdin (`djlint -`). Stdin previously always carried the name `-`, which no realistic `per-file-ignores` pattern matches, so per-file ignores were silently dead for piped input; the given name is now what `per-file-ignores` matches against and what linter messages report. Editor integrations that lint the open buffer through stdin get the same per-file ignores as a run over the file on disk. Path separators are normalized the same way they are for files on disk, so a Windows-style path matches a pattern written with `/`.
9+
- New `--stdin-filename` option gives content piped in on stdin (`djlint -`) its real path, so `per-file-ignores` matches against that name and linter messages report it. Per-file ignores were previously dead for piped input, since nothing matches the name `-`. Path separators are normalized as they are for files on disk.
1010

1111
### Fix
1212

13-
- An apostrophe in the text of a template tag nested in an attribute value (`title="{% translate "You don't have permission" %}"`) no longer swallows the rest of the document. The tag scanner read the template tag's own quotes as ending the attribute, which left the apostrophe looking like the start of a quoted value; that value never closed, so no tag after it was seen at all and `H025` reported every enclosing element as an orphan. A template tag inside a value is now skipped whole, as long as it holds no `>` - a quoted literal like `a="{{"` is still left alone, since the `}}` a naive search settles on always lies beyond the `>` that ends the tag.
14-
15-
- A line that starts with a closing tag and ends with a whole tag (`</span>tail<textarea>y</textarea>`) unindents again. Such a line is not written by the branch that unindents, so nothing gave the level back and everything after it stayed one level too deep. What a line owes back is now settled from the level it ends on rather than from an assumption about which branch will write it.
16-
17-
- A template block tag followed by a whole html tag on the same line (`{% endif %} <td class="x">y</td>`, `{% else %} <td class="x">y</td>`) indents as a block tag again. The line was handled as if it were only that html tag, so `{% endif %}` did not unindent and `{% else %}` did not align with its `{% if %}` - and since the line only takes that shape once the tag it holds fits on one line, reformatting an already formatted file moved it.
18-
19-
- A tag opened after the end of a verbatim block on the same line (`</pre> <span>x`) is tracked again. That line is written out as part of the block, so the tag it opened went unrecorded while the `</span>` closing it on a later line still took a level - from whichever tag was opened before the block - dedenting that tag's siblings by one.
20-
21-
- A template control block written across lines is kept that way even when it opens against a tag (`<div>{% if x %}`), and the choice is no longer applied to the wrong block. Which blocks to leave spread (#1597) was recorded from the source and then paired off against the expanded html by position, but the two do not line up - expanding splits some lines and joins others, and a block written against a tag was not recorded at all. One missing entry shifted every later block onto another block's setting, so a block the author spread was collapsed while an inline one was left spread. Blocks are now matched by tag and contents rather than by position.
22-
23-
- A tag whose `style`, `srcset`, `data-srcset` or `sizes` value was written over several lines is no longer spread over multiple lines and then pulled back together on the next run. Flattening such a value leaves a space against each quote, and those spaces counted toward `max_attribute_length` even though rewriting the value drops them - a tag two characters over the limit was spread, came back under it, and collapsed again. The limit is now measured against what will actually be written out.
24-
25-
- A `<pre>` or `<textarea>` opened on a line that also holds a self-contained comment (`<pre>x<!--c-->`) is recognized as opening a verbatim block again. It was not, so its contents were re-indented instead of left alone, and the closing `</pre>` gained one indent level on **every** format run - unbounded whitespace growth inside preformatted text, which changes what the page renders. The check looked for a block opening only after the last self-contained block on the line, missing an opening that comes before one.
26-
27-
- A closing tag that starts its line no longer dedents when the tag it closes was opened after text on an earlier line. The counterpart of the fix above, on the other code path and predating it: `text <b>bold` / `</b> tail` inside a `<p>` shifted the closing `</p>` and every following sibling one level left, and the loss accumulated, so a document repeating that shape drifted further left with each occurrence until it hit column 0. A closing tag with nothing to pair against - unbalanced markup, or a tag opened outside the file - still dedents as before.
28-
29-
- A `<` inside a one-line `<script>`, `<style>`, `<textarea>` or `<title>` no longer counts as a tag when indenting. The content of those elements is text, not markup, so `<script>var a = '<span>'</script>` left an unclosed `<span>` on the formatter's tag stack and shifted everything after it - the indent given back to a following closing tag went to the phantom instead, leaving that tag and its siblings one level too deep.
30-
31-
- An inline element that opens after text on its line and closes on a later line no longer dedents everything that follows it by one level. Since 1.40.8 the formatter gave back an indent level whenever a line closed more html tags than it opened, but a line only takes an indent level when the opening tag starts it, so `text <b>bold` / `more</b> tail` inside a `<p>` pushed the closing `</p>` and every following sibling one level to the left. The dedent is now paired with the indent it undoes, so it only fires for a tag that owned the start of its line, and the shape from #834 keeps its dedent. The wrong output was idempotent, so it silently survived later runs.
32-
33-
- A Go template comment `{{/* ... */}}` is no longer read as a block close tag. It starts with `{{/`, the handlebars block-close prefix (`{{/if}}`), so it popped a block off the stack: `H037` lost track of which conditional branch each attribute was in and reported `Duplicate attribute found.` for mutually exclusive attributes such as `<a {{if .A}}href="a"{{else}}{{/* c */}}href="b"{{end}}>`, and the formatter unindented the rest of the block, leaving `{{ end }}` and everything before it one level too far left. Relatedly, a comment renders as nothing, so `H037` no longer treats one as a template-generated attribute name prefix (as in `{% if x %}data-{% endif %}srcset`) and hides a real duplicate behind it, for either `{{/* ... */}}` or handlebars `{{! ... }}` / `{{!-- ... --}}`.
34-
35-
- A tag that merely touches an ignored block is no longer treated as being inside it. A tag ending exactly where an ignored block starts (or starting exactly where one ends) - such as `{% if x %}{# comment #}` - was skipped by the linter, which both hid real problems and produced false reports for the tags that depended on it. Most visibly, `T038` reported `End tag has no matching block tag` for the `{% endif %}` of an `{% if %}` followed immediately by a `{# ... #}` comment, and stayed silent about a genuinely unclosed one. Affects every rule that skips ignored blocks (`H025`, `H037`, `H041`, `H042`, `T002`, `T003`, `T027`, `T038`, `T039`) and every kind of ignored block (`{# ... #}`, `<!-- ... -->`, `<script>`, `<pre>`, `{% comment %}`, etc.). Tags that genuinely overlap or sit inside an ignored block are still skipped as before.
36-
37-
- A bare `djlint:off` pragma no longer ignores the tag written immediately before it. `<img>{# djlint:off #}` silently dropped every error on that `<img>`, while the equivalent `<img>{# djlint:off H013 #}` correctly reported it - a pragma covers what follows it, not what precedes it. Both forms now agree. A pragma still covers matches that end inside it, so wrapping part of a tag in `{# djlint:off #}` ... `{# djlint:on #}` keeps working.
13+
- An apostrophe inside a template tag nested in an attribute value (`title="{% translate "You don't have permission" %}"`) no longer swallows the rest of the document, which made `H025` report every enclosing element as an orphan. A template tag in a value is now skipped whole unless it holds a `>`, so a quoted literal like `a="{{"` is still left alone.
14+
- A line that starts with a closing tag and ends with a whole tag (`</span>tail<textarea>y</textarea>`) unindents again; everything after it stayed one level too deep.
15+
- A template block tag followed by a whole html tag on the same line (`{% endif %} <td class="x">y</td>`) indents as a block tag again, so `{% endif %}` unindents and `{% else %}` aligns with its `{% if %}`. A line only takes that shape once the tag fits on one line, so reformatting an already formatted file moved it.
16+
- A tag opened after the end of a verbatim block on the same line (`</pre> <span>x`) is tracked again; its closing tag took a level from a tag opened before the block, dedenting that tag's siblings.
17+
- A template control block written across lines is kept that way when it opens against a tag (`<div>{% if x %}`), and the choice is no longer applied to the wrong block. Blocks were paired with the source by position, which does not line up with the expanded html; they are now matched by tag and contents.
18+
- A tag whose `style`, `srcset`, `data-srcset` or `sizes` value was written over several lines is no longer spread over multiple lines and pulled back together on the next run. `max_attribute_length` is now measured against what is written out, not against padding that the rewrite drops.
19+
- A `<pre>` or `<textarea>` opened on a line that also holds a self-contained comment (`<pre>x<!--c-->`) is recognized as opening a verbatim block again. Its contents were re-indented instead of left alone, and the closing `</pre>` gained an indent level on every run - unbounded whitespace growth inside preformatted text.
20+
- A closing tag that starts its line no longer dedents when the tag it closes was opened after text on an earlier line (`text <b>bold` / `</b> tail`). The loss accumulated, so a document repeating that shape drifted further left with each occurrence. A closing tag with nothing to pair against still dedents as before.
21+
- A `<` inside a one-line `<script>`, `<style>`, `<textarea>` or `<title>` no longer counts as a tag when indenting. `<script>var a = '<span>'</script>` left a phantom open `<span>` on the tag stack, leaving everything after it one level too deep.
22+
- An inline element that opens after text on its line and closes on a later line no longer dedents everything that follows it by one level (`text <b>bold` / `more</b> tail` inside a `<p>`) - a regression in 1.40.8. The wrong output was idempotent, so it survived later runs.
23+
- A Go template comment `{{/* ... */}}` is no longer read as a block close tag. It starts with `{{/`, the handlebars block-close prefix, so it popped a block off the stack: `H037` reported `Duplicate attribute found.` for mutually exclusive attributes such as `<a {{if .A}}href="a"{{else}}{{/* c */}}href="b"{{end}}>`, and the formatter unindented the rest of the block. A comment renders as nothing, so `H037` no longer treats one as a template-generated attribute name prefix either.
24+
- A tag that merely touches an ignored block is no longer treated as being inside it. A tag ending exactly where an ignored block starts - such as `{% if x %}{# comment #}` - was skipped by the linter, most visibly making `T038` report `End tag has no matching block tag` for a balanced `{% if %}`. Affects every rule that skips ignored blocks (`H025`, `H037`, `H041`, `H042`, `T002`, `T003`, `T027`, `T038`, `T039`) and every kind of ignored block.
25+
- A bare `djlint:off` pragma no longer ignores the tag written immediately before it. `<img>{# djlint:off #}` silently dropped every error on that `<img>`, while `<img>{# djlint:off H013 #}` correctly reported it - a pragma covers what follows it, not what precedes it.
3826

3927
## [1.42.3] - 2026-07-23
4028

0 commit comments

Comments
 (0)