#36341 closed Bug (fixed)
django.utils.text.wrap does not preserve newlines within text to be wrapped
Reported by: | Matti Pohjanvirta | Owned by: | Matti Pohjanvirta |
---|---|---|---|
Component: | Template system | Version: | 5.2 |
Severity: | Release blocker | Keywords: | |
Cc: | Sarah Boyce | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After the fix for CVE-2025-26699, django.utils.text.wrap and wordwrap template filter no longer preserve empty lines in between lines in a text that is wrapped.
Given a text with an intentional empty line between paragraphs to wrap:
First line Second line
it is wrapped to:
First line Second line
Change History (16)
comment:1 by , 7 weeks ago
Has patch: | set |
---|
comment:2 by , 7 weeks ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 7 weeks ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 7 weeks ago
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
comment:5 by , 7 weeks ago
Cc: | added |
---|
comment:7 by , 7 weeks ago
Needs documentation: | unset |
---|---|
Patch needs improvement: | unset |
Triage Stage: | Accepted → Ready for checkin |
comment:10 by , 7 weeks ago
After the PR merge I realized we need to backport this to 5.1 and 4.2 as well, I'll be preparing a PR with releases notes and backport both revisions.
Note:
See TracTickets
for help on using tickets.
Hello Matti Pohjanvirta, thank you very much for taking the time to create this report. I can confirm this is a regression in 55d89e25f4115c5674cdd9b9bcba2bb2bb6d820b. I will review your patch shortly, could you please double check that the patch does not add any exploitable performance issues?