From 5f62b92ffe1cf28c1133a65fed6e5cd52bfe1a8a Mon Sep 17 00:00:00 2001 From: Vesper Date: Fri, 27 Mar 2026 21:30:06 +0000 Subject: [PATCH] Try to strip HTML from the plain text body field --- src/app/hooks/useCommands.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/hooks/useCommands.ts b/src/app/hooks/useCommands.ts index a1c90f17..edd901d9 100644 --- a/src/app/hooks/useCommands.ts +++ b/src/app/hooks/useCommands.ts @@ -1331,7 +1331,14 @@ export const useCommands = (mx: MatrixClient, room: Room): CommandRecord => { exe: async (payload) => { await mx.sendMessage(room.roomId, { msgtype: MsgType.Text, - body: payload, + body: payload + .replaceAll('
', '\n') + .replaceAll('
  • ', '\n- ') + .replaceAll( + /(.*?))"(.*?)>(?(.*?))<\/a>/g, + '[$]($)' + ) + .replaceAll(/<[^>]*>/g, ''), format: 'org.matrix.custom.html', formatted_body: payload, });