From 509019b2a95a4b768da31ba7990bb2dd3759ad4f Mon Sep 17 00:00:00 2001 From: auric Date: Sun, 22 Feb 2026 21:31:55 -0600 Subject: umbrella-bot: add nl2br extension to preserve newlines in Matrix messages markdown.markdown() collapses single newlines into soft wraps, causing multi-line responses (e.g. !units list) to render as one long line. The nl2br extension converts \n to
in the HTML output. Co-Authored-By: Claude Sonnet 4.6 --- clients/umbrella-bot/umbrella-bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clients') diff --git a/clients/umbrella-bot/umbrella-bot.py b/clients/umbrella-bot/umbrella-bot.py index d6c6edb..ef90fc8 100755 --- a/clients/umbrella-bot/umbrella-bot.py +++ b/clients/umbrella-bot/umbrella-bot.py @@ -399,7 +399,7 @@ async def run_bot(config: dict): "msgtype": "m.text", "body": reply, "format": "org.matrix.custom.html", - "formatted_body": md_lib.markdown(reply, extensions=["fenced_code"]), + "formatted_body": md_lib.markdown(reply, extensions=["fenced_code", "nl2br"]), }, ignore_unverified_devices=True, ) -- cgit v1.2.3