From 5ce9842d19df196269d79358e04bad031cdfd850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Thu, 4 Apr 2024 16:19:00 +0200 Subject: [PATCH] Correctly convert newlines when handling rich Slack messages Fixes GH-547 --- src/SlackGhost.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SlackGhost.ts b/src/SlackGhost.ts index 9fd574e2..98f28f11 100644 --- a/src/SlackGhost.ts +++ b/src/SlackGhost.ts @@ -318,7 +318,7 @@ export class SlackGhost { } public prepareFormattedBody(body: string): string { - return Slackdown.parse(body); + return Slackdown.parse(body).replace("\n", "
"); } public async sendInThread(roomId: string, text: string, slackRoomId: string, @@ -361,7 +361,7 @@ export class SlackGhost { const content = { body, format: "org.matrix.custom.html", - formatted_body: Slackdown.parse(text), + formatted_body: this.prepareFormattedBody(text), msgtype: "m.text", ...extra, };