Skip to content

[rejected AI] Fix indent filter handling of empty first lines - #2270

Closed
LouisDeconinck wants to merge 1 commit into
pallets:mainfrom
LouisDeconinck:fix/indent-first-blank-2176
Closed

LouisDeconinck wants to merge 1 commit into
pallets:mainfrom
LouisDeconinck:fix/indent-first-blank-2176

Conversation

@LouisDeconinck

Copy link
Copy Markdown

Fixes #2176

The indent filter currently prepends the indentation string when first=True, even if the first line is empty and blank=False. This produces whitespace for an empty filtered block.

Use the first line's content when deciding whether first should indent, while preserving blank=True behavior. The existing filter tests now cover the regression.

Checks:

  • git diff --check
  • Four direct focused render assertions (the repository test suite could not run because Trio is not installed in the environment).

The change is limited to the filter, its regression test, and CHANGES.rst.

@ThiefMaster

Copy link
Copy Markdown
Member

@davidism davidism changed the title Fix indent filter handling of empty first lines [rejected AI] Fix indent filter handling of empty first lines Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

indent filter ignores blank=False when first=True on first line

3 participants