diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-14 19:00:07 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-14 19:00:07 +0700 |
commit | e82e73478e577782407bc8452d17925675d99d10 (patch) | |
tree | 0784beff0a57cbeb239215314e0436b7f0a5253f /test/web/common_api/common_api_utils_test.exs | |
parent | 23276e8d6848fa8eae390c16b6e0619c12546e4a (diff) | |
parent | cdcdbd88da76f18c21da7f6f15a29883044902c8 (diff) | |
download | pleroma-e82e73478e577782407bc8452d17925675d99d10.tar.gz |
Merge remote-tracking branch 'pleroma/develop' into feature/addressable-lists
Diffstat (limited to 'test/web/common_api/common_api_utils_test.exs')
-rw-r--r-- | test/web/common_api/common_api_utils_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs index 837a66063..ab4c62b35 100644 --- a/test/web/common_api/common_api_utils_test.exs +++ b/test/web/common_api/common_api_utils_test.exs @@ -119,6 +119,31 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do assert output == expected end + test "works for bare text/bbcode" do + text = "[b]hello world[/b]" + expected = "<strong>hello world</strong>" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + + text = "[b]hello world![/b]\n\nsecond paragraph!" + expected = "<strong>hello world!</strong><br>\n<br>\nsecond paragraph!" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + + text = "[b]hello world![/b]\n\n<strong>second paragraph!</strong>" + + expected = + "<strong>hello world!</strong><br>\n<br>\n<strong>second paragraph!</strong>" + + {output, [], []} = Utils.format_input(text, "text/bbcode") + + assert output == expected + end + test "works for text/markdown with mentions" do {:ok, user} = UserBuilder.insert(%{nickname: "user__test", ap_id: "http://foo.com/user__test"}) |