Skip to content

Commit

Permalink
Fix nl2br example in documentation
Browse files Browse the repository at this point in the history
The nl2br filter example in the documentation does not work as is.

I needed to make some changes to make it work.
  • Loading branch information
ronnix authored Dec 4, 2024
1 parent ada0a9a commit ead568f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,10 @@ enabled before escaping the input and marking the output safe.
br = Markup(br)
result = "\n\n".join(
f"<p>{br.join(p.splitlines())}<\p>"
f"<p>{br.join(p.splitlines())}</p>"
for p in re.split(r"(?:\r\n|\r(?!\n)|\n){2,}", value)
)
return Markup(result) if autoescape else result
return Markup(result) if eval_ctx.autoescape else result
.. _writing-tests:
Expand Down

0 comments on commit ead568f

Please sign in to comment.