Skip to content

Strip trailing whitespace from the indent filter #681

@ypid

Description

@ypid

Expected Behavior

first.line

....third.line

Actual Behavior

first.line
....
....third.line

Template Code/MWE

#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""first line

third line
"""

from jinja2 import Template

t = Template("{{ multline_string | indent(4) }}")
print(t.render(multline_string=__doc__).replace(" ", "."))

Your Environment

  • Python version: 2.7.9-1
  • Jinja version: 2.8-1~bpo8+1

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