Improve Formatter.minify/2

This commit is contained in:
Alex Gleason 2020-10-13 01:53:25 -05:00 committed by Mark Felder
parent e9e17e5df3
commit ba71bbf610
1 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,10 @@ def minify({text, mentions, hashtags}, type) do
end
def minify(text, "text/html") do
String.replace(text, "\n", "")
text
|> String.replace(">\n", ">")
|> String.replace("> ", ">")
|> String.replace(" <", "<")
end
def truncate(text, max_length \\ 200, omission \\ "...") do