Another bug in HTML::BBCode

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


It seems like HTML::BBCode does have a list of bugs, this is the second
one I noticed in a few days. This time, the bug is in the [code]-block,
have a look at the following script:


use strict;
use warnings;
use HTML::BBCode;

my $bbc = HTML::BBCode->new({
  no_html => 1,
  linebreaks => 1 });

my $bbcode=<<'BBCODE';
some code

print $bbc->parse($bbcode);

This will incorrectly output:

<div class="bbcode_code_header">Code:</div><div
/></div><br />

When displayed in a web browser, you'll notice that you don't see the
and BBCodes, but the HTML-output it generates.
I also made a patch for this bug, here's the diff (this diff includes
the modifications I made a few posts ago, to fix the [list]-bug):

<        if($self-> ne '' && $end ne
"[/$self->]") {
Quoted text here. Click to load it
<          _open_tag($self, $1);
Quoted text here. Click to load it
<    $content =~ s|\[\*\]([^(\[]+)|<li>$1</li>|gs;
Quoted text here. Click to load it

I'll also notify the author of HTML::BBCode.

greets, YorHel

Site Timeline