mirror of https://github.com/zulip/zulip.git
minor: Refactor `user_mention_re` to match characters except `>`.
The regex could have match a bunch of characters including `>` and hence end up matching across multiple adjacent spans in a weird way. This commit fixes such an issue.
This commit is contained in:
parent
5bab65e82f
commit
e50d189191
|
@ -218,7 +218,7 @@ export function apply_markdown(message) {
|
|||
},
|
||||
silencedMentionHandler(quote) {
|
||||
// Silence quoted mentions.
|
||||
const user_mention_re = /<span.*user-mention.*data-user-id="(\d+|\*)"[^>]*>@/gm;
|
||||
const user_mention_re = /<span[^>]*user-mention[^>]*data-user-id="(\d+|\*)"[^>]*>@/gm;
|
||||
quote = quote.replace(user_mention_re, (match) => {
|
||||
match = match.replace(/"user-mention"/g, '"user-mention silent"');
|
||||
match = match.replace(/>@/g, ">");
|
||||
|
|
Loading…
Reference in New Issue