From 4c01a49310e22010b053704a3dd7a81425ce1da9 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 9 Aug 2025 22:00:29 +0300 Subject: [PATCH] Don't cut off body if there's nothing there --- maubot/matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maubot/matrix.py b/maubot/matrix.py index a99c1a4..7f1ec0f 100644 --- a/maubot/matrix.py +++ b/maubot/matrix.py @@ -63,7 +63,7 @@ async def parse_formatted( else: return message, escape(message) text = (await MaubotHTMLParser().parse(html)).text - if len(text) + len(html) > 40000: + if len(text) > 100 and len(text) + len(html) > 40000: text = text[:100] + "[long message cut off]" return text, html