You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the issue is the regexp in ement--format-body-mentions. For a @ immediately following a newline, that initial (or bos bow (1+ blank)) doesn't match because @ isn't word syntax, and newlines aren't [:blank:]. Let's simply add a newline to that set of alternatives?
(rx (or bos bow (1+ blank))
(or (seq (group
;; Group 1: full @-prefixed MXID."@" (group
;; Group 2: displayname. (NOTE: Does not work;; with displaynames containing spaces.)
(1+ (seq (optional ".") alnum)))
(optional ":" (1+ (seq (optional ".") alnum))))
(or":" eow eos (syntax punctuation)))
(seq (group
;; Group 3: MXID username or displayname.
(1+ (not blank)))
":" (1+ blank))))
The text was updated successfully, but these errors were encountered:
Does that 1+ help? Maybe preventing some potential backtracking? It doesn't look necessary for matching purposes, but I'm interested to know if it's better that way.
If there's no benefit to that, then I think we could alternatively simplify slightly to:
phil-s
changed the title
Usernames aren't linked at the beginnings of lines, except for the first line
@usernames aren't linked at the beginnings of lines, except for the first line
Mar 11, 2024
For the following example message, the first username on the second line does not end up linked:
So the respective output end up like this:
It looks like the issue is the regexp in
ement--format-body-mentions
. For a@
immediately following a newline, that initial(or bos bow (1+ blank))
doesn't match because@
isn't word syntax, and newlines aren't[:blank:]
. Let's simply add a newline to that set of alternatives?The text was updated successfully, but these errors were encountered: