summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2018-12-18 20:23:21 +0000
committerlambda <pleromagit@rogerbraun.net>2018-12-18 20:23:21 +0000
commitb7f635010710147f0682c538ebf783066124f0d4 (patch)
tree15fa1e5e7544749c3cd51b879454145ffbe0b317 /test
parent443d59baa05165c3b5b7ab14f3eabd6f2eba09f2 (diff)
parent196d9c0fd089942deff62aeeea60bef1972cbe38 (diff)
downloadpleroma-b7f635010710147f0682c538ebf783066124f0d4.tar.gz
pleroma-b7f635010710147f0682c538ebf783066124f0d4.zip
Merge branch 'fix/formatter-ignore-html-chars' into 'develop'
[#441] Fix characters converted to HTML being picked up by hashtag parser See merge request pleroma/pleroma!575
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index bb318b7d5..6cdfa4167 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -22,6 +22,18 @@ defmodule Pleroma.FormatterTest do
assert expected_text ==
Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
end
+
+ test "does not turn html characters to tags" do
+ text = "Fact #3: pleroma does what mastodon't"
+
+ expected_text =
+ "Fact <a data-tag='3' href='http://localhost:4001/tag/3' rel='tag'>#3</a>: pleroma does what mastodon't"
+
+ tags = Formatter.parse_tags(text)
+
+ assert expected_text ==
+ Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
+ end
end
describe ".add_links" do