diff options
| author | bwarsaw | 1998-07-22 21:24:18 +0000 |
|---|---|---|
| committer | bwarsaw | 1998-07-22 21:24:18 +0000 |
| commit | cd79e27fb5734e98146264bc722a0a91c574aa24 (patch) | |
| tree | a3abcae274f1a070a6be2b1fea534e22d1bf48e6 | |
| parent | 5659e3a64b175de1412e43fc79fdbf5d994ad78a (diff) | |
| download | mailman-cd79e27fb5734e98146264bc722a0a91c574aa24.tar.gz mailman-cd79e27fb5734e98146264bc722a0a91c574aa24.tar.zst mailman-cd79e27fb5734e98146264bc722a0a91c574aa24.zip | |
| -rw-r--r-- | Mailman/Utils.py | 11 |
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=[]): |
