aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2019-04-26 22:38:56 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2019-04-26 22:45:45 +0000
commitef52aa0e6647d00f5ff984d655ef4b27ab3e6b1a (patch)
tree44cf64d20b0562a3fbde217cc49f6fcf6a40891d
parent501af917b5a9611a4b1fabb4944b3af96b676568 (diff)
downloadpleroma-ef52aa0e6647d00f5ff984d655ef4b27ab3e6b1a.tar.gz
tests: fix up for changed bbcode library output and verify html is properly escaped
-rw-r--r--test/web/common_api/common_api_utils_test.exs11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
index df9955d5d..ab4c62b35 100644
--- a/test/web/common_api/common_api_utils_test.exs
+++ b/test/web/common_api/common_api_utils_test.exs
@@ -128,7 +128,16 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
assert output == expected
text = "[b]hello world![/b]\n\nsecond paragraph!"
- expected = "<strong>hello world!</strong><br><br>second 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&lt;strong&gt;second paragraph!&lt;/strong&gt;"
{output, [], []} = Utils.format_input(text, "text/bbcode")