Skip to content

indent filter uses \n always rather than following api newline_sequence #2016

Open
@jmbraben

Description

indent filter uses \n always rather than following api newline_sequence

Configure the environment with newline_sequence="\r\n"
Then use the indent filter on a multi-line macro
The returned content uses \n instead of \r\n

The expanded/indented macro should be using \r\n for end of line sequence
This would appear to be relevant source code:
https://github.com/pallets/jinja/blob/main/src/jinja2/filters.py#L835

Environment:

  • Python version: 3.8.10
  • Jinja version: 3.1.4

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