diff options
author | duponin <pwet@dupon.in> | 2022-05-21 04:17:34 +0200 |
---|---|---|
committer | duponin <pwet@dupon.in> | 2022-05-21 04:17:34 +0200 |
commit | 33ced2c2ed9391ec95aae2205bb30d987ceac86d (patch) | |
tree | d860d772895c68da3a0fb5cc68b31f49804e8cac | |
parent | b128e1d6c5bbc78874d05af2676550de80ae85c7 (diff) | |
download | pleroma-33ced2c2ed9391ec95aae2205bb30d987ceac86d.tar.gz |
BBS: put a new line for each HTML break in an activity
Otherwise it would just put each line on the first one, which is not
really readable
-rw-r--r-- | lib/pleroma/bbs/handler.ex | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/pleroma/bbs/handler.ex b/lib/pleroma/bbs/handler.ex index c2491a20c..d641de9ac 100644 --- a/lib/pleroma/bbs/handler.ex +++ b/lib/pleroma/bbs/handler.ex @@ -42,9 +42,14 @@ defmodule Pleroma.BBS.Handler do def puts_activity(activity) do status = Pleroma.Web.MastodonAPI.StatusView.render("show.json", %{activity: activity}) + IO.puts("-- #{status.id} by #{status.account.display_name} (#{status.account.acct})") - IO.puts(status.content |> HTML.strip_tags() |> HtmlEntities.decode()) - IO.puts("") + + status.content + |> String.split("<br/>") + |> Enum.map(&HTML.strip_tags/1) + |> Enum.map(&HtmlEntities.decode/1) + |> Enum.map(&IO.puts/1) end def handle_command(state, "help") do |