summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/Utils.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 4d73e8751..b143d66e8 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -135,11 +135,18 @@ def wrap(text, column=70):
bol = bol + 1
bol = bol - 1
line = text[:eol+1] + '\n'
- text = text[bol+1:]
+ # find the next non-whitespace character
+ bol = bol + 1
+ while bol < len(text) and text[bol] in string.whitespace:
+ bol = bol + 1
+ text = text[bol:]
wrapped = wrapped + line
wrapped = wrapped + '\n'
+ # end while text
wrapped = wrapped + '\n'
- return wrapped
+ # end for text in lines
+ # the last two newlines are bogus
+ return wrapped[:-2]
def SendTextToUser(subject, text, recipient, sender, add_headers=[]):