summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VNDB/BBCode.pm10
-rwxr-xr-xutil/bbcode-test.pl10
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/VNDB/BBCode.pm b/lib/VNDB/BBCode.pm
index b95ef760..d2f3135d 100644
--- a/lib/VNDB/BBCode.pm
+++ b/lib/VNDB/BBCode.pm
@@ -111,11 +111,11 @@ sub parse {
my @stack;
while($raw =~ m{(?:
- \[[^\s\]]+\] | # tag
- d[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]* | # d#.#.#
- [tdvprcs][1-9][0-9]*\.[1-9][0-9]* | # v#.#
- [tdvprcsugi][1-9][0-9]* | # v#
- (?:https?|ftp)://[^><"\n\s\]\[]+[\d\w=/-] # link
+ \[ \/? (?i: spoiler|quote|code|url|raw ) [^\s\]]* \] | # tag
+ d[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]* | # d#.#.#
+ [tdvprcs][1-9][0-9]*\.[1-9][0-9]* | # v#.#
+ [tdvprcsugi][1-9][0-9]* | # v#
+ (?:https?|ftp)://[^><"\n\s\]\[]+[\d\w=/-] # link
)}xg) {
my $token = $&;
my $pre = substr $raw, $last, $-[0]-$last;
diff --git a/util/bbcode-test.pl b/util/bbcode-test.pl
index 07133aca..ba39fb13 100755
--- a/util/bbcode-test.pl
+++ b/util/bbcode-test.pl
@@ -109,10 +109,10 @@ my @tests = (
'<a href="/v17">v17</a> text dds16v21 more text1 <a href="/v9">v9</a>',
'v17 text dds16v21 more text1 v9',
- # https://vndb.org/t2520.231
- 'pov1',
- 'pov1',
- 'pov1',
+ # https://vndb.org/t2520.233
+ '[From[url=http://densetsu.com/display.php?id=468&style=alphabetical] Anime Densetsu[/url]]',
+ '[From<a href="http://densetsu.com/display.php?id=468&amp;style=alphabetical" rel="nofollow"> Anime Densetsu</a>]',
+ '[From Anime Densetsu]',
# Not sure what to do here
#'http://some[raw].pointlessly[/raw].unusual.domain/',
@@ -166,6 +166,8 @@ my @invalid_syntax = (
'[url=nicetext]simpler invalid param[/url]',
'[url]empty "url" tag[/url]',
'[tag]custom tag[/tag]',
+ # https://vndb.org/t2520.231
+ 'pov1',
);