diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 3634a8f5b..b30e04e3d 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -144,7 +144,7 @@ def get_custom_emoji() do @emoji end - @link_regex ~r/https?:\/\/[\w\.\/?=\-#%&@~\(\)]+[\w\/]/u + @link_regex ~r/https?:\/\/[\w\.\/?=\-#\+%&@~\(\)]+[\w\/]/u def html_escape(text) do Regex.split(@link_regex, text, include_captures: true) diff --git a/test/formatter_test.exs b/test/formatter_test.exs index d9cef8abc..ff882f8f1 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -57,6 +57,13 @@ test "turning urls into links" do "https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul" assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected + + text = "https://www.google.co.jp/search?q=Nasim+Aghdam" + + expected = + "https://www.google.co.jp/search?q=Nasim+Aghdam" + + assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected end end