Skip to content

Commit deaaec2

Browse files
committed
Simplify mention detection regex.
I wonder if we can change this later to pick out the matrix.to url for the mxid instead and save scanning the displayname.
1 parent 4132e9d commit deaaec2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Adaptor/CommandDispatcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ function maybeExtractMarkdownMention(
144144
clientUserID: StringUserID,
145145
normalisedPrefix: string
146146
): string | undefined {
147-
const result = /^\[(\S+)\]\(\S+\)\s*:?\s*/.exec(body);
147+
const result = /^\[([^\]]+)\]\([^)]+\)\s*:?\s*/.exec(body);
148148
if (result === null) {
149149
return undefined;
150150
}

0 commit comments

Comments
 (0)