X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fformatter.ex;h=1e4ede3f2c8fea4ba484a62ca2194208161cbef8;hb=a2e03d4f3cfc7ccae98ae19db253aec8f1d3e9d0;hp=51d08c5ee7b3e88b3360d625f4f4c8b3a8a1a261;hpb=1c265b3b19bacd2e0a9ccfee0f7e53a59d83a621;p=akkoma diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 51d08c5ee..1e4ede3f2 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -10,6 +10,7 @@ defmodule Pleroma.Formatter do @markdown_characters_regex ~r/(`|\*|_|{|}|[|]|\(|\)|#|\+|-|\.|!)/ @link_regex ~r{((?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~%:/?#[\]@!\$&'\(\)\*\+,;=.]+)|[0-9a-z+\-\.]+:[0-9a-z$-_.+!*'(),]+}ui + # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength @auto_linker_config hashtag: true, hashtag_handler: &Pleroma.Formatter.hashtag_handler/4, @@ -91,6 +92,10 @@ defmodule Pleroma.Formatter do def get_emoji(_), do: [] + def html_escape({text, mentions, hashtags}, type) do + {html_escape(text, type), mentions, hashtags} + end + def html_escape(text, "text/html") do HTML.filter_tags(text) end