Skip to content

Commit

Permalink
Make regex ungreedy
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Dec 1, 2023
1 parent 17816c4 commit 68109b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/SlackMessageParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class SlackMessageParser {

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

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

0 comments on commit 68109b3

Please sign in to comment.