diff options
author | Alex Gleason <alex@alexgleason.me> | 2022-01-27 14:28:06 -0600 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2023-09-13 19:19:04 -0400 |
commit | bee7e419597615ac6852942fe563166feba3fe73 (patch) | |
tree | 16d4090acbe67e25761c9fdfb4ac6ea7e3691722 /test | |
parent | 74e0a4555f583a6962ad116bf6e54f06e42fe465 (diff) | |
download | pleroma-bee7e419597615ac6852942fe563166feba3fe73.tar.gz pleroma-bee7e419597615ac6852942fe563166feba3fe73.zip |
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.exs | 21 |
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 |