mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-24 02:02:19 +00:00
formatter: adjust regexp captures to match local users with single character nicknames (closes #163)
This commit is contained in:
parent
14d1187702
commit
3e10d13909
|
@ -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