Skip to content

Commit

Permalink
Correctly convert newlines when handling rich Slack messages
Browse files Browse the repository at this point in the history
Fixes GH-547
  • Loading branch information
tadzik committed Apr 4, 2024
1 parent 6db082f commit 5ce9842
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SlackGhost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class SlackGhost {
}

public prepareFormattedBody(body: string): string {
return Slackdown.parse(body);
return Slackdown.parse(body).replace("\n", "<br>");
}

public async sendInThread(roomId: string, text: string, slackRoomId: string,
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 5ce9842

Please sign in to comment.