fix email

This commit is contained in:
Claudio 2025-09-07 19:56:47 +02:00
parent 77c938e8de
commit 9447d62c27

View File

@ -64,10 +64,14 @@ def _ensure_html_blocks(s):
else:
parts = [p.strip() for p in s.split("\n\n") if p.strip()]
if len(parts) > 1:
body = "".join(f"<p>{html_lib.escape(p).replace('\n','<br>')}</p>" for p in parts)
body = "".join(
"<p>{}</p>".format(html_lib.escape(p).replace("\n", "<br>"))
for p in parts
)
else:
body = "<p>" + html_lib.escape(s).replace("\n", "<br>") + "</p>"
return f"<!doctype html><html><body>{body}</body></html>"
body = "<p>{}</p>".format(html_lib.escape(s).replace("\n", "<br>"))
return "<!doctype html><html><body>{}</body></html>".format(body)
def _make_quoted_original(body_text):
"""Crea il blocco citato del messaggio originale, safe-escaped."""