From 640838d5a64ab3e087bafa9d9e8bdcf5ce796278 Mon Sep 17 00:00:00 2001 From: Algis Dumbris Date: Sun, 15 Mar 2026 19:43:00 +0200 Subject: [PATCH] feat: MessageBody component with markdown, links, @mentions, #channels Replace plain-text message rendering with a rich MessageBody component that supports bold, italic, inline code, fenced code blocks, lists, headers, auto-linked URLs, @mention pills (linking to /dm/{name}), and #channel pills (linking to /channels/{name}). Input is HTML-sanitized before processing to prevent XSS. Updated all 5 rendering locations: channels, DMs, conversations, MessageList, and ThreadPanel. Co-Authored-By: Claude Opus 4.6 (1M context) --- web/src/lib/components/MessageBody.svelte | 262 ++++++++++++++++++ web/src/lib/components/MessageList.svelte | 3 +- web/src/lib/components/ThreadPanel.svelte | 3 +- web/src/routes/channels/[name]/+page.svelte | 3 +- .../routes/conversations/[id]/+page.svelte | 3 +- web/src/routes/dm/[name]/+page.svelte | 3 +- 6 files changed, 272 insertions(+), 5 deletions(-) create mode 100644 web/src/lib/components/MessageBody.svelte diff --git a/web/src/lib/components/MessageBody.svelte b/web/src/lib/components/MessageBody.svelte new file mode 100644 index 0000000..816c77d --- /dev/null +++ b/web/src/lib/components/MessageBody.svelte @@ -0,0 +1,262 @@ + + +
+ {@html rendered} +
+ + diff --git a/web/src/lib/components/MessageList.svelte b/web/src/lib/components/MessageList.svelte index 1c8d995..eb9875a 100644 --- a/web/src/lib/components/MessageList.svelte +++ b/web/src/lib/components/MessageList.svelte @@ -1,5 +1,6 @@