projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
14d1187
)
formatter: adjust regexp captures to match local users with single character nickname...
author
William Pitcock
<nenolod@dereferenced.org>
Fri, 24 Aug 2018 18:18:48 +0000
(18:18 +0000)
committer
William Pitcock
<nenolod@dereferenced.org>
Fri, 24 Aug 2018 18:22:47 +0000
(18:22 +0000)
lib/pleroma/formatter.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/formatter.ex
b/lib/pleroma/formatter.ex
index 3e71a3b5f04cd444b50fcac03f4e35390a6dcb24..cf2944c38fffa668ba6526dfd415af9ea10458ef 100644
(file)
--- a/
lib/pleroma/formatter.ex
+++ b/
lib/pleroma/formatter.ex
@@
-16,7
+16,7
@@
defmodule Pleroma.Formatter do
def parse_mentions(text) do
# Modified from https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
regex =
- ~r/@[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]
+
@?[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/u
+ ~r/@[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]
*
@?[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/u
Regex.scan(regex, text)
|> List.flatten()