aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2022-01-27 14:28:06 -0600
committerAlex Gleason <alex@alexgleason.me>2022-01-27 14:28:06 -0600
commit087e060d3008341cabbb18f7bb7ec46e3b169df1 (patch)
tree940f8ff798993c4dce00629cd0fc32fb27800ca4 /test
parent91822c383c20faf870874eb1812bc1f810b571b0 (diff)
downloadpleroma-087e060d3008341cabbb18f7bb7ec46e3b169df1.tar.gz
InlineQuotePolicy: don't add line breaks to markdown posts
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/activity_pub/mrf/inline_quote_policy_test.exs21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/pleroma/web/activity_pub/mrf/inline_quote_policy_test.exs b/test/pleroma/web/activity_pub/mrf/inline_quote_policy_test.exs
index 81dc06dda..8e75aaaab 100644
--- a/test/pleroma/web/activity_pub/mrf/inline_quote_policy_test.exs
+++ b/test/pleroma/web/activity_pub/mrf/inline_quote_policy_test.exs
@@ -14,6 +14,25 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicyTest do
"actor" => "https://gleasonator.com/users/alex",
"object" => %{
"type" => "Note",
+ "content" => "Nice post",
+ "quoteUrl" => quote_url
+ }
+ }
+
+ {:ok, %{"object" => %{"content" => filtered}}} = InlineQuotePolicy.filter(activity)
+
+ assert filtered ==
+ "Nice post<span class=\"quote-inline\"><br><br>RT: <a href=\"https://gleasonator.com/objects/1234\">https://gleasonator.com/objects/1234</a></span>"
+ end
+
+ test "doesn't add line breaks to markdown posts" do
+ quote_url = "https://gleasonator.com/objects/1234"
+
+ activity = %{
+ "type" => "Create",
+ "actor" => "https://gleasonator.com/users/alex",
+ "object" => %{
+ "type" => "Note",
"content" => "<p>Nice post</p>",
"quoteUrl" => quote_url
}
@@ -22,7 +41,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.InlineQuotePolicyTest do
{:ok, %{"object" => %{"content" => filtered}}} = InlineQuotePolicy.filter(activity)
assert filtered ==
- "<p>Nice post</p><span class=\"quote-inline\"><br><br>RT: <a href=\"https://gleasonator.com/objects/1234\">https://gleasonator.com/objects/1234</a></span>"
+ "<p>Nice post</p><span class=\"quote-inline\">RT: <a href=\"https://gleasonator.com/objects/1234\">https://gleasonator.com/objects/1234</a></span>"
end
test "ignores Misskey quote posts" do