end)
end
- def get_emoji(text) do
+ def get_emoji(text) when is_binary(text) do
Enum.filter(@emoji, fn {emoji, _} -> String.contains?(text, ":#{emoji}:") end)
end
+ def get_emoji(_), do: []
+
def get_custom_emoji() do
@emoji
end
]
# TODO: make it use something other than @link_regex
- def html_escape(text, "text/html") do
- HtmlSanitizeEx.basic_html(text)
- end
-
- def html_escape(text, "text/plain") do
+ def html_escape(text) do
Regex.split(@link_regex, text, include_captures: true)
|> Enum.map_every(2, fn chunk ->
{:safe, part} = Phoenix.HTML.html_escape(chunk)