summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorauric <auric@japegames.com>2026-02-22 21:31:55 -0600
committerauric <auric@japegames.com>2026-02-22 21:31:55 -0600
commit509019b2a95a4b768da31ba7990bb2dd3759ad4f (patch)
treeeaba1a9ad46d83b57adff41031ef239bf1d2444f /clients
parentf1af8621c19390b81847eeccd4e47b1ddb42d4ab (diff)
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 <br> in the HTML output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'clients')
-rwxr-xr-xclients/umbrella-bot/umbrella-bot.py2
1 files changed, 1 insertions, 1 deletions
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,
)