From: William Pitcock Date: Fri, 24 Aug 2018 18:18:48 +0000 (+0000) Subject: formatter: adjust regexp captures to match local users with single character nickname... X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=3e10d13909d3801d26b5cbf86a376e2ed370e2cc;p=akkoma formatter: adjust regexp captures to match local users with single character nicknames (closes #163) --- diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 3e71a3b5f..cf2944c38 100644 --- 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()