From 33d297636a0b429e1c30bbe70e744065a7ccf6a0 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Fri, 1 Dec 2023 11:03:50 +0100 Subject: [PATCH 1/3] Make regex ungreedy --- src/SlackGhost.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SlackGhost.ts b/src/SlackGhost.ts index 9fd574e2..acfbce7e 100644 --- a/src/SlackGhost.ts +++ b/src/SlackGhost.ts @@ -314,7 +314,7 @@ export class SlackGhost { public prepareBody(body: string): string { // TODO: This is fixing plaintext mentions, but should be refactored. // See https://github.com/matrix-org/matrix-appservice-slack/issues/110 - return body.replace(//g, "$1"); + return body.replace(/]+)>/g, "$1"); } public prepareFormattedBody(body: string): string { From 6ca45361637dc4886a95574773bb5d2f954c622b Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Fri, 1 Dec 2023 11:37:43 +0100 Subject: [PATCH 2/3] Add changelog entry --- changelog.d/772.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/772.bugfix diff --git a/changelog.d/772.bugfix b/changelog.d/772.bugfix new file mode 100644 index 00000000..a648cb91 --- /dev/null +++ b/changelog.d/772.bugfix @@ -0,0 +1 @@ +Fix swallowed text between 2 mentions From cdf27ac82044610d61a0237bc9c491451ee41417 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 7 Dec 2023 19:17:22 +0100 Subject: [PATCH 3/3] Add full stop, props @ashfame --- changelog.d/772.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/772.bugfix b/changelog.d/772.bugfix index a648cb91..70cfa305 100644 --- a/changelog.d/772.bugfix +++ b/changelog.d/772.bugfix @@ -1 +1 @@ -Fix swallowed text between 2 mentions +Fix swallowed text between 2 mentions.