summaryrefslogtreecommitdiff
path: root/util/bbcode-test.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-07-22 13:23:52 +0200
committerYorhel <git@yorhel.nl>2020-07-22 13:23:52 +0200
commit67fd861fb74110b9a2170d72cf5dd69ffa1f19be (patch)
tree10bd0aaec3483977dde1c487dae99ad839c1449e /util/bbcode-test.pl
parentd6a601ad264360293c325019203a97902d8a9708 (diff)
BBCode: Add support for [b], [i], [s], and [u] formatting codes
Diffstat (limited to 'util/bbcode-test.pl')
-rwxr-xr-xutil/bbcode-test.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/util/bbcode-test.pl b/util/bbcode-test.pl
index 0ad0f3ea..d08f70c9 100755
--- a/util/bbcode-test.pl
+++ b/util/bbcode-test.pl
@@ -40,6 +40,10 @@ my @tests = (
'<b class="spoiler">some spoiler</b>',
'',
+ '[b][i][u][s]Formatting![/s][/u][/i][/b]',
+ '<b><em><span class="underline"><s>Formatting!</s></span></em></b>',
+ 'Formatting!',
+
"[raw][quote]not parsed\n[url=https://vndb.org/]valid url[/url]\n[url=asdf]invalid url[/url][/quote][/raw]",
"[quote]not parsed<br>[url=https://vndb.org/]valid url[/url]<br>[url=asdf]invalid url[/url][/quote]",
"[quote]not parsed\n[url=https://vndb.org/]valid url[/url]\n[url=asdf]invalid url[/url][/quote]",
@@ -48,6 +52,18 @@ my @tests = (
'<div class="quote">basic <b class="spoiler">single</b>-line <b class="spoiler"><a href="/g" rel="nofollow">tag</a> nesting (without [url=/v3333]special[/url] cases)</b></div>',
'basic -line ',
+ '[quote][b]more [spoiler]nesting [code]mkay?',
+ '<div class="quote"><b>more <b class="spoiler">nesting [code]mkay?</b></b></div>',
+ 'more ',
+
+ '[url=/v][b]does not work here[/b][/url]',
+ '<a href="/v" rel="nofollow">[b]does not work here[/b]</a>',
+ '[b]does not work here[/b]',
+
+ '[s] v5 [url=/p1]x[/url] [/s]',
+ '<s> <a href="/v5">v5</a> <a href="/p1" rel="nofollow">x</a> </s>',
+ ' v5 x ',
+
"[quote]rmnewline after closing tag[/quote]\n",
'<div class="quote">rmnewline after closing tag</div>',
"rmnewline after closing tag\n",