summaryrefslogtreecommitdiff
path: root/test/formatter_test.exs
diff options
context:
space:
mode:
authorraeno <just.raeno@gmail.com>2018-12-18 14:59:32 +0100
committerraeno <just.raeno@gmail.com>2018-12-18 14:59:32 +0100
commita3003364598b42849e384a216948dad810481f51 (patch)
tree2ed2b04efab457220a60fb7630906b1b26f24df3 /test/formatter_test.exs
parent30812f84518f1b2fcc70a416d1a6b9f81264f3a5 (diff)
parentb6ae412fcd7c67d64dd1467e8e35d17140e992df (diff)
downloadpleroma-a3003364598b42849e384a216948dad810481f51.tar.gz
pleroma-a3003364598b42849e384a216948dad810481f51.zip
Merge branch 'develop' into oembed_provider
Diffstat (limited to 'test/formatter_test.exs')
-rw-r--r--test/formatter_test.exs19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 428227d78..bb318b7d5 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -257,4 +257,23 @@ defmodule Pleroma.FormatterTest do
text = nil
assert Formatter.get_emoji(text) == []
end
+
+ describe "/mentions_escape" do
+ test "it returns text with escaped mention names" do
+ text = """
+ @a_breakin_glass@cybre.space
+ (also, little voice inside my head thinking "maybe this will encourage people
+ pronouncing it properly instead of saying _raKEWdo_ ")
+ """
+
+ escape_text = """
+ @a\\_breakin\\_glass@cybre\\.space
+ (also, little voice inside my head thinking \"maybe this will encourage people
+ pronouncing it properly instead of saying _raKEWdo_ \")
+ """
+
+ mentions = [{"@a_breakin_glass@cybre.space", %{}}]
+ assert Formatter.mentions_escape(text, mentions) == escape_text
+ end
+ end
end