commit: ba71bbf6101847292346ba3b1fbe78ce4c385919
parent e9e17e5df34051bce60232890ea042582af31f8c
Author: Alex Gleason <alex@alexgleason.me>
Date: Tue, 13 Oct 2020 01:53:25 -0500
Improve Formatter.minify/2
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex
@@ -143,7 +143,10 @@ defmodule Pleroma.Formatter 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