forked from mirrors/akkoma
formatter: adjust regexp captures to match local users with single character nicknames (closes #163)
This commit is contained in:
parent
14d1187702
commit
3e10d13909
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ defmodule Pleroma.Formatter do
|
||||||
def parse_mentions(text) do
|
def parse_mentions(text) do
|
||||||
# Modified from https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
# Modified from https://www.w3.org/TR/html5/forms.html#valid-e-mail-address
|
||||||
regex =
|
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)
|
Regex.scan(regex, text)
|
||||||
|> List.flatten()
|
|> List.flatten()
|
||||||
|
|
Loading…
Reference in a new issue