diff options
author | href <href+git-pleroma@random.sh> | 2018-12-14 20:30:35 +0000 |
---|---|---|
committer | href <href+git-pleroma@random.sh> | 2018-12-14 20:30:35 +0000 |
commit | e74f384b685edff5e4fac9da788a7516dd83fe94 (patch) | |
tree | 85c4462b333b2d8d58291fc81b6e8db002cddb8c /test | |
parent | bfe27c1b557b19c171c8168c5f1244987246c47f (diff) | |
parent | bc6262d2503fa5a9656898fa2dcd91b2111cf2b5 (diff) | |
download | pleroma-e74f384b685edff5e4fac9da788a7516dd83fe94.tar.gz |
Merge branch 'fix/issue_433' into 'develop'
[#433] fix markdown formatting
See merge request pleroma/pleroma!545
Diffstat (limited to 'test')
-rw-r--r-- | test/formatter_test.exs | 19 |
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 |