Closed phil-s closed 3 months ago
This?
- (regexp (rx (or bos bow (1+ blank))
+ (regexp (rx (or bos bow (1+ (or blank "\n"))
Looks like it does the trick.
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:
- (regexp (rx (or bos bow (1+ blank))
+ (regexp (rx (or bos bow blank "\n")
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?