diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex
index 557faf454..735d88832 100644
--- a/lib/pleroma/web/twitter_api/twitter_api.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api.ex
@@ -13,6 +13,7 @@ def create_status(user = %User{}, data = %{}) do
context = ActivityPub.generate_context_id
content = HtmlSanitizeEx.strip_tags(data["status"])
+ |> String.replace("\n", "
")
mentions = parse_mentions(content)
diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs
index eb5f8ec26..b8bfb4cf9 100644
--- a/test/web/twitter_api/twitter_api_test.exs
+++ b/test/web/twitter_api/twitter_api_test.exs
@@ -27,13 +27,13 @@ test "create a status" do
object = Repo.insert!(%Object{data: object_data})
input = %{
- "status" => "Hello again, @shp.",
+ "status" => "Hello again, @shp.\nThis is on another line.",
"media_ids" => [object.id]
}
{ :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input)
- assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp."
+ assert get_in(activity.data, ["object", "content"]) == "Hello again, @shp.
This is on another line."
assert get_in(activity.data, ["object", "type"]) == "Note"
assert get_in(activity.data, ["object", "actor"]) == user.ap_id
assert get_in(activity.data, ["actor"]) == user.ap_id