X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fformatter.ex;h=e95a314b484c1d661dd41d7994ca95e0f0282df2;hb=0df4a0f26d96442d80afed1d332602269e29b65e;hp=179c33560412469e3ef4feab55abfffa79259584;hpb=66b4fee80ebad58d3a7ed2457d522e8f862d9e71;p=akkoma
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
index 179c33560..e95a314b4 100644
--- a/lib/pleroma/formatter.ex
+++ b/lib/pleroma/formatter.ex
@@ -1,7 +1,7 @@
defmodule Pleroma.Formatter do
alias Pleroma.User
- @link_regex ~r/https?:\/\/[\w\.\/?=\-#%&]+[\w]/
+ @link_regex ~r/https?:\/\/[\w\.\/?=\-#%&]+[\w]/u
def linkify(text) do
Regex.replace(@link_regex, text, "\\0")
end
@@ -14,7 +14,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])?)*/
+ 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
Regex.scan(regex, text)
|> List.flatten
@@ -91,7 +91,7 @@ defmodule Pleroma.Formatter do
]
Enum.reduce(emoji_list, text, fn (emoji, text) ->
- String.replace(text, ":#{String.replace(emoji, "_", "")}:", "
")
+ String.replace(text, ":#{String.replace(emoji, "_", "")}:", "
")
end)
end
end