|
@@ -6,6 +6,7 @@ import pendulum
|
|
|
import subprocess
|
|
|
import base64
|
|
|
import os
|
|
|
+import textwrap
|
|
|
|
|
|
base_path = "/messagebase"
|
|
|
|
|
@@ -183,7 +184,10 @@ def display_message(area, msgno):
|
|
|
# message["bytes"].replace(b"\r", b"\n"), msgno
|
|
|
# )
|
|
|
else:
|
|
|
- message["text"] = message["text"].replace("\r", "\n") # <br >\n")
|
|
|
+ text = message["text"].replace("\r", "\n")
|
|
|
+ # Ok, latest changes aren't doing word-wrap for us, so do it here.
|
|
|
+ text = "\n".join( [ textwrap.fill(txt, width=78, replace_whitespace=False) for txt in text.splitlines()] )
|
|
|
+ message["text"] = text; # message["text"].replace("\r", "\n") # <br >\n")
|
|
|
|
|
|
return render_template(
|
|
|
"message.html",
|