[Metadata] Fix actors not sanitizing their description and refactor

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-17 15:45:08 +01:00
parent a115b49b4c
commit 15a82c7bce
5 changed files with 80 additions and 32 deletions

View File

@@ -32,7 +32,7 @@ defmodule Mobilizon.Service.Formatter.HTML do
@spec strip_tags_and_insert_spaces(String.t()) :: String.t()
def strip_tags_and_insert_spaces(html) when is_binary(html) do
html
|> String.replace("</", " </")
|> String.replace("><", "> <")
|> strip_tags()
end