diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-07 16:51:11 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-05-07 16:51:11 +0700 |
commit | 1557b99beb3b406572ef2d3baaabed1c9baeca1c (patch) | |
tree | 34041b8526ecfa38fcb0b471718de0b3b71aa8c4 /test/web/common_api/common_api_utils_test.exs | |
parent | c157e27a000a12dc8f660c056744a6611beb01b1 (diff) | |
parent | 6518644db1d31f2b30b95fa0899b3751bc330d56 (diff) | |
download | pleroma-1557b99beb3b406572ef2d3baaabed1c9baeca1c.tar.gz pleroma-1557b99beb3b406572ef2d3baaabed1c9baeca1c.zip |
Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
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"}) |