Skip to content

Commit 33d2976

Browse files
committed
Make regex ungreedy
1 parent ed85fc6 commit 33d2976

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SlackGhost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export class SlackGhost {
314314
public prepareBody(body: string): string {
315315
// TODO: This is fixing plaintext mentions, but should be refactored.
316316
// See https://github.com/matrix-org/matrix-appservice-slack/issues/110
317-
return body.replace(/<https:\/\/matrix\.to\/#\/@.+:.+\|(.+)>/g, "$1");
317+
return body.replace(/<https:\/\/matrix\.to\/#\/@[^:]+:[^|]+\|([^>]+)>/g, "$1");
318318
}
319319

320320
public prepareFormattedBody(body: string): string {

0 commit comments

Comments
 (0)