Skip to content

Commit 68109b3

Browse files
committed
Make regex ungreedy
1 parent 17816c4 commit 68109b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SlackMessageParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class SlackMessageParser {
237237

238238
// TODO: This is fixing plaintext mentions, but should be refactored.
239239
// https://github.com/matrix-org/matrix-appservice-slack/issues/110
240-
body = body.replace(/<https:\/\/matrix\.to\/#\/@.+:.+\|(.+)>/g, "$1");
240+
body = body.replace(/<https:\/\/matrix\.to\/#\/@[^:]+:[^|]+\|([^>]+)>/g, "$1");
241241

242242
// Convert plain text body to HTML.
243243
// We first run it through Slackdown, which will convert some elements to HTML.

0 commit comments

Comments
 (0)