Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
remove comment
  • Loading branch information
ruslandoga committed Dec 19, 2024
commit fd25f510230523be7b25b5aba3166cccfa9d73ec
8 changes: 3 additions & 5 deletions lib/plausible_web/email.ex
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,13 @@ defmodule PlausibleWeb.Email do

defp traverse_and_textify(other), do: other

# - replace all consecutive spaces with a single space
# - remove spaces at the beginning and end of each line
defp collapse_whitespace(text) do
String.split(text, "\n")
|> Enum.map(fn line ->
text
|> String.split("\n")
|> Enum.map_join("\n", fn line ->
line
|> String.split(" ", trim: true)
|> Enum.join(" ")
end)
|> Enum.join("\n")
end
end