Subject: | Incorrect work with limited set of tags |
I found that module works wrong if I use limited list of tags and unallowed tag meets first in parsed text. Example below
#!/usr/bin/perl
use strict;
use HTML::BBCode;
my $p1 = new HTML::BBCode({
allowed_tags => [ qw( b i u img ) ]
});
my $p2 = new HTML::BBCode({
allowed_tags => [ qw( b i u ) ]
});
my $text1 = <<"EOB";
[img=http://phpbb.com/logo.gif]phpBB logo[/img]
[b]BBCode[/b] - is a simple [i]markup language[/i] used in [url=http://phpbb.com/]phpBB[/url].
EOB
my $text2 = <<"EOB";
[b]BBCode[/b] - is a simple [i]markup language[/i] used in [url=http://phpbb.com/]phpBB[/url].
[img=http://phpbb.com/logo.gif]phpBB logo[/img]
EOB
print "1st parser 1 text\n", $p1->parse( $text1 ), "\n";
print "2nd parser 1 text (wrong)\n", $p2->parse( $text1 ), "\n";
print "1st parser 2 text\n", $p1->parse( $text2 ), "\n";
print "2nd parser 2 text\n", $p2->parse( $text2 ), "\n";