Strip all newlines in atom html content to work around mastodon bug.
authorRoger Braun <roger@rogerbraun.net>
Mon, 31 Jul 2017 11:31:21 +0000 (13:31 +0200)
committerRoger Braun <roger@rogerbraun.net>
Mon, 31 Jul 2017 11:31:21 +0000 (13:31 +0200)
lib/pleroma/web/ostatus/activity_representer.ex

index cf5c89107d7c0a7418bfb0189e9068c43555e5d3..03e3d26bdbc804a65cf31e8c22a0da46ea0befc8 100644 (file)
@@ -48,7 +48,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
       {:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']},
       {:id, h.(activity.data["object"]["id"])}, # For notes, federate the object id.
       {:title, ['New note by #{user.nickname}']},
-      {:content, [type: 'html'], h.(activity.data["object"]["content"])},
+      {:content, [type: 'html'], h.(activity.data["object"]["content"] |> String.replace(~r/[\n\r]/, ""))},
       {:published, h.(inserted_at)},
       {:updated, h.(updated_at)},
       {:"ostatus:conversation", [], h.(activity.data["context"])},