From 61692c7efae4f8c6dc0e5b07276979f4237dee33 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Tue, 27 Mar 2018 02:00:04 -0400 Subject: [PATCH 1/3] Include the '#' symbol into the link itself --- lib/pleroma/formatter.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 2d3487f6a..4afc73bf4 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -189,7 +189,7 @@ def add_hashtag_links({subs, text}, tags) do end) subs = subs ++ Enum.map(tags, fn ({_, tag, uuid}) -> - url = "#" + url = "" {uuid, url} end) From 5ba2f4b6d8ba9f80a392b1298758f257d59cb853 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Tue, 27 Mar 2018 02:07:07 -0400 Subject: [PATCH 2/3] Update tests to reflect hashtag link changes --- test/formatter_test.exs | 2 +- test/web/twitter_api/twitter_api_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 0e915d8d5..9ec2cc9f2 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -7,7 +7,7 @@ defmodule Pleroma.FormatterTest do describe ".add_hashtag_links" do test "turns hashtags into links" do text = "I love #cofe and #2hu" - expected_text = "I love # and #" + expected_text = "I love and " tags = Formatter.parse_tags(text) assert expected_text == Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 7d578a751..740371880 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -34,7 +34,7 @@ test "create a status" do { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input) - expected_text = "Hello again, @shp.<script></script>
This is on another :moominmamma: line. # # #
image.jpg" + expected_text = "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #
image.jpg" assert get_in(activity.data, ["object", "content"]) == expected_text assert get_in(activity.data, ["object", "type"]) == "Note" assert get_in(activity.data, ["object", "actor"]) == user.ap_id From 9556c8f6e720a1b63df16d7165a40936b52fc0b4 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Tue, 27 Mar 2018 02:08:46 -0400 Subject: [PATCH 3/3] Forgot to fix one of the links in a test --- test/web/twitter_api/twitter_api_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/web/twitter_api/twitter_api_test.exs b/test/web/twitter_api/twitter_api_test.exs index 740371880..715a746ef 100644 --- a/test/web/twitter_api/twitter_api_test.exs +++ b/test/web/twitter_api/twitter_api_test.exs @@ -34,7 +34,7 @@ test "create a status" do { :ok, activity = %Activity{} } = TwitterAPI.create_status(user, input) - expected_text = "Hello again, @shp.<script></script>
This is on another :moominmamma: line. #
image.jpg" + expected_text = "Hello again, @shp.<script></script>
This is on another :moominmamma: line.
image.jpg" assert get_in(activity.data, ["object", "content"]) == expected_text assert get_in(activity.data, ["object", "type"]) == "Note" assert get_in(activity.data, ["object", "actor"]) == user.ap_id