formatter: adjust regexp captures to match local users with single character nickname...
authorWilliam Pitcock <nenolod@dereferenced.org>
Fri, 24 Aug 2018 18:18:48 +0000 (18:18 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Fri, 24 Aug 2018 18:22:47 +0000 (18:22 +0000)
lib/pleroma/formatter.ex

index 3e71a3b5f04cd444b50fcac03f4e35390a6dcb24..cf2944c38fffa668ba6526dfd415af9ea10458ef 100644 (file)
@@ -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()