Parse::BBCode(3pm)

πŸ“¦
version 0.15 Β· 2 versions
  • 0.15 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.15 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Parse::BBCode β€” the module that parses BBCode and renders it as HTML or text. Yes bestie, this is the one. It's the Parse::BBCode(3pm) page you're looking at, and it is so much. Grab a snack. πŸ“


✨ SYNOPSIS ✨

So Parse::BBCode parses common bbcode like

[b]bold[/b] [size=10]big[/size]

short tags like

[foo://test]

and custom bbcode tags. Fr fr, all three.

For the documentation of short tags, go read "SHORT TAGS". πŸ‘‘

To parse a bbcode string, set up a parser with the default HTML definitions of Parse::BBCode::HTML:

# render bbcode to HTML
use Parse::BBCode;
my $p = Parse::BBCode->new();
my $code = 'some [b]b code[/b]';
my $rendered = $p->render($code);

# parse bbcode, manipulate tree and render
use Parse::BBCode;
my $p = Parse::BBCode->new();
my $code = 'some [b]b code[/b]';
my $tree = $p->parse($code);
# do something with $tree
my $rendered = $p->render_tree($tree);

Or if you want to define your own tags β€” main character energy, honestly β€” it looks like this:

my $p = Parse::BBCode->new({
        tags => {
            # load the default tags
            Parse::BBCode::HTML->defaults,

            # add/override tags
            url => 'url:<a href="%{link}A">%{parse}s</a>',
            i   => '<i>%{parse}s</i>',
            b   => '<b>%{parse}s</b>',
            noparse => '<pre>%{html}s</pre>',
            code => sub {
                my ($parser, $attr, $content, $attribute_fallback) = @_;
                if ($attr eq 'perl') {
                    # use some syntax highlighter
                    $content = highlight_perl($content);
                }
                else {
                    $content = Parse::BBCode::escape_html($$content);
                }
                "<tt>$content</tt>"
            },
            test => 'this is klingon: %{klingon}s',
        },
        escapes => {
            klingon => sub {
                my ($parser, $tag, $text) = @_;
                return translate_into_klingon($text);
            },
        },
    }
);
my $code = 'some [b]b code[/b]';
my $parsed = $p->render($code);

🌸 DESCRIPTION 🌸

Okay so here's the vibe. If you set up the Parse::BBCode object without arguments, the default tags get loaded, and any text outside or inside of parseable tags will go through a default subroutine which escapes HTML and replaces newlines with <br> tags. If you need to change this you can set the options 'url_finder', 'text_processor' and 'linebreaks'. That's the whole deal. πŸ’…


🫢 METHODS 🫢

✨ new

Constructor. Takes a hash reference with options as an argument. It's giving "here's my config, do your thing."

my $parser = Parse::BBCode->new({
    tags => {
        url => ...,
        i   => ...,
    },
    escapes => {
        link => ...,
    },
    close_open_tags   => 1, # default 0
    strict_attributes => 0, # default 1
    direct_attributes => 1, # default 1
    url_finder        => 1, # default 0
    smileys           => 0, # default 0
    linebreaks        => 1, # default 1
});

Now let's go through every single one, because we don't skip. 🧚

  • tags β€” See "TAG DEFINITIONS".
  • escapes β€” See "ESCAPES".
  • url_finder β€” See "URL FINDER".
  • smileys β€” if you want to replace smileys with an icon, literally:
my $parser = Parse::BBCode->new({
        smileys => {
            base_url => '/your/url/to/icons/',
            icons => { qw/ :-) smile.png :-( sad.png / },
            # sprintf format:
            # first argument url
            # second argument original text smiley (HTML escaped)
            format => '<img src="%s" alt="%s">',
            # if you need the url and text in a different order
            # see perldoc -f sprintf, e.g.
            # format => '<img alt="%2$s" src="%1$s">',
        },
    });

This subroutine will be applied during the url_finder (or first, if url_finder is 0), and the rest will get processed by the text procesor (default escaping html and replacing linebreaks).

Smileys are only replaced if surrounded by whitespace or start/end of line/text.

[b]bold<hr> :-)[/b] :-(

In this example both smileys will be replaced. The first smiley is at the end of the text because the text inside [b][/b] is processed on its own.

Open to any suggestions here. πŸ‘€

  • linebreaks β€” the default text processor replaces linebreaks with <br>\n. If you don't want this, set 'linebreaks' to 0. Simple as that.
  • text_processor β€” if you need to add any customized text processing (like smiley parsing, for example), you can pass a subroutine here. Note that this subroutine also needs to do HTML escaping itself! Don't forget, bestie, it's on you.

See "TEXT PROCESSORS".

  • close_open_tags β€” Default: 0

If set to true (1), it will close open tags at the end or before block tags.

  • strict_attributes β€” Default: 1

If set to true (1), tags with invalid attributes are left unparsed. If set to false (0), the attribute for this tags will be empty.

An invalid attribute, for the record:

[foo=bar far boo]...[/foo]

I might add an option to define your own attribute validation. Contact me if you'd like to have this. 🫢

  • direct_attributes β€” Default: 1

Normal tag syntax is:

[tag=val1 attr2=val2 ...]

If set to 0, tag syntax is

[tag attr2=val2 ...]
  • attribute_quote β€” you can change how the attribute values shuold be quoted. Default is a double quote (which is still optional):
my $parser = Parse::BBCode->new(
    attribute_quote => '"',
    ...
);
[tag="foo" attr="bar" attr2=baz]...[/tag]

If you set it to single quote:

my $parser = Parse::BBCode->new(
    attribute_quote => "'",
    ...
);
[tag='foo' attr=bar attr2='baz']...[/tag]

You can also set it to both: "'"". Then both quoting types are allowed:

my $parser = Parse::BBCode->new(
    attribute_quote => q/'"/,
    ...
);
[tag='foo' attr="bar" attr2=baz]...[/tag]
  • attribute_parser β€” you can pass a subref that overrides the default attribute parsing. See "ATTRIBUTE PARSING".
  • strip_linebreaks β€” Default: 1

Strips linebreaks at start/end of block tags.


🌈 render

  • Input: The text to parse, optional hashref
  • Returns: the rendered text
my $rendered = $parser->render($bbcode);

You can pass an optional hashref with information you need inside of your self-defined rendering subs. For example if you want to display code in a codebox with a link to download the code you need the id of the article (in a forum) and the number of the code tag.

my $parsed = $parser->render($bbcode, { article_id => 23 });
# in the rendering sub:
    my ($parser, $attr, $content, $attribute_fallback, $tag, $info) = @_;
    my $article_id = $parser->get_params->{article_id};
    my $code_id = $tag->get_num;
    # write downloadlink like
    # download.pl?article_id=$article_id;code_id=$code_id
    # in front of the displayed code

See examples/code_download.pl for a complete example of how to set up the rendering and how to extract the code from the tree. If run as a CGI skript it will give you a dialogue to save the code into a file, including a reasonable default filename. Iconic behaviour honestly. πŸ’–


πŸ¦‹ parse

  • Input: The text to parse.
  • Returns: the parsed tree (a Parse::BBCode::Tag object)
my $tree = $parser->parse($bbcode);

πŸŽ€ render_tree

  • Input: the parse tree
  • Returns: The rendered text
my $parsed = $parser->render_tree($tree);

You can pass an optional hashref, for explanation see "render".


πŸ’œ forbid

$parser->forbid(qw/ img url /);

Disables the given tags. Bye bye, tags. πŸ™ˆ


πŸ’œ permit

$parser->permit(qw/ img url /);

Enables the given tags if they are in the tag definitions.


⭐ escape_html

Utility to substitute

<>&"'

with their HTML entities.

my $escaped = Parse::BBCode::escape_html($text);

πŸ”₯ error

If the given bbcode is invalid (unbalanced or wrongly nested classes), currently Parse::BBCode::render() will either leave the invalid tags unparsed, or, if you set the option "close_open_tags", try to add closing tags. If this happened "error()" will return the invalid tag(s), otherwise false. To get the corrected bbcode (if you set "close_open_tags") you can get the tree and return the raw text from it:

if ($parser->error) {
    my $tree = $parser->get_tree;
    my $corrected = $tree->raw_text;
}

🌸 parse_attributes

You can inherit from Parse::BBCode and define your own attribute parsing. See "ATTRIBUTE PARSING".


πŸ‘‘ new_tag

Returns a Parse::BBCode::Tag object. It just does:

shift;
Parse::BBCode::Tag->new(@_);

If you want your own tag class, inherit from Parse::BBCode and let it return Parse::BBCode::YourTag->new


πŸ’… TAG DEFINITIONS πŸ’…

Here is an example of all the current definition possibilities:

my $p = Parse::BBCode->new({
        tags => {
            i   => '<i>%s</i>',
            b   => '<b>%{parse}s</b>',
            size => '<font size="%a">%{parse}s</font>',
            url => 'url:<a href="%{link}A">%{parse}s</a>',
            wikipedia => 'url:<a href="http://wikipedia.../?search=%{uri}A">%{parse}s</a>',
            noparse => '<pre>%{html}s</pre>',
            quote => 'block:<blockquote>%s</blockquote>',
            code => {
                code => sub {
                    my ($parser, $attr, $content, $attribute_fallback) = @_;
                    if ($attr eq 'perl') {
                        # use some syntax highlighter
                        $content = highlight_perl($$content);
                    }
                    else {
                        $content = Parse::BBCode::escape_html($$content);
                    }
                    "<tt>$content</tt>"
                },
                parse => 0,
                class => 'block',
            },
            hr => {
                class => 'block',
                output => '<hr>',
                single => 1,
            },
        },
    }
);

okay bestie so this is the moment where all of that above finally makes sense πŸ’… the following list explains those tag definitions one by one, no cap:

%s

i => '<i>%s</i>'
[i] italic <html> [/i]
turns out as
<i> italic &lt;html&gt; </i>

so %s is literally just a lil placeholder for the tag's content, okay? ✨ and by default it gets parsed itself, which is exactly how you get to nest tags inside other tags. iconic behaviour tbh.

"%{parse}s"

b   => '<b>%{parse}s</b>'
[b] bold <html> [/b]
turns out as
<b> bold &lt;html&gt; </b>

"%{parse}s" is giving exactly the same energy as plain %s, because 'parse' is the default anyway. periodt.

%a

size => '<font size="%a">%{parse}s</font>'
[size=7] some big text [/size]
turns out as
<font size="7"> some big text </font>

so %a = the tag attribute. and by default it gets HTML escaped, so you're safe 🫢

url => 'url:<a href="%{link}a">%{parse}s</a>'

first thing you'll clock is that "url:" sitting at the very front β€” that's what defines the url tag as a tag with the class 'url', and urls must not be nested. so this class definition is mainly there to stop you from generating wrong HTML. if you nest url tags, only the outer one gets parsed. sorry babe, that's the rule πŸ™ˆ

another thing you'll see is how to apply a special escape. the attribute defined with "%{link}a" gets checked for a valid URL. "javascript:" will be filtered. yes bestie, filtered as in bye. πŸ’€

[url=/foo.html]a link[/url]
turns out as
<a href="/foo.html">a link</a>

and note that a tag like

[url]http://some.link.example[/url]

will turn out as

<a href="">http://some.link.example</a>

for the cases where the attribute should be the same as the content, you should use %A instead of %a β€” it takes the content as the attribute as a fallback. you probs need this in basically all url-like tags:

url => 'url:<a href="%{link}A">%{parse}s</a>',

"%{uri}A"

you might wanna define your own urls, e.g. for wikipedia references:

wikipedia => 'url:<a href="http://wikipedia/?search=%{uri}A">%{parse}s</a>',

"%{uri}A" will uri-encode the searched term:

[wikipedia]Harold & Maude[/wikipedia]
[wikipedia="Harold & Maude"]a movie[/wikipedia]
turns out as
<a href="http://wikipedia/?search=Harold+%26+Maude">Harold &amp; Maude</a>
<a href="http://wikipedia/?search=Harold+%26+Maude">a movie</a>

Don't parse tag content

sometimes you need to display verbatim bbcode. the simplest form would be a noparse tag:

noparse => '<pre>%{html}s</pre>'
[noparse] [some]unbalanced[/foo] [/noparse]

with this definition the output would be

<pre> [some]unbalanced[/foo] </pre>

so inside a noparse tag you can write (almost) any invalid bbcode 🌈 the only exception is the noparse tag itself:

[noparse] [some]unbalanced[/foo] [/noparse] [b]really bold[/b] [/noparse]

output:

[some]unbalanced[/foo] <b>really bold</b> [/noparse]

because the noparse tag ends at the first closing tag, even if you've got an extra opening noparse tag tucked inside. it's giving "the math is mathing but also chaotic" 😭

the "%{html}s" defines that the content should be HTML escaped. if you don't want any escaping you can't just say %s, because the default is 'parse'. in that case you have to write "%{noescape}".

Block tags

quote => 'block:<blockquote>%s</blockquote>',

to force valid html you can add classes to tags. the default class is 'inline'. to declare it as a block, add "'block:" to the start of the string. block tags inside of inline tags will either close the outer tag(s) or leave the outer tag(s) unparsed, depending on the option "close_open_tags". so yeah, choose wisely πŸ‘‘

Define subroutine for tag

all these definitions might not be enough if you wanna define your own code, for example to add a syntax highlighter.

here's an example:

code => {
    code => sub {
        my ($parser, $attr, $content, $attribute_fallback, $tag, $info) = @_;
        if ($attr eq 'perl') {
            # use some syntax highlighter
            $content = highlight_perl($$content);
        }
        else {
            $content = Parse::BBCode::escape_html($$content);
        }
        "<tt>$content</tt>"
    },
    parse => 0,
    class => 'block',
},

so instead of a string you define a hash reference with a 'code' key and a sub reference πŸŽ€ the other key is "parse", which is 0 by default. if it's 0 the content in the tag won't be parsed, just like in the noparse tag above. if it's set to 1 you'll get the rendered content as an argument to the subroutine.

the first argument to the subroutine is the Parse::BBCode object itself. the second argument is the attribute, the third is the already rendered tag content as a scalar reference, and the fourth argument is the attribute fallback, which is set to the content if the attribute is empty. the fourth argument is just for convenience, bestie πŸ’– the fifth argument is the tag object (Parse::BBCode::Tag) itself, so if you need to you can get the original tag content by using:

my $original = $tag->raw_text;

the sixth argument is an info hash. it contains:

my $info = {
    tags => $tags,
    stack => $stack,
    classes => $classes,
};

the variable $tags is a hashref which contains all tag names which are outside the current tag, with a count. this is convenient if you have to check whether the current processed tag is inside a certain tag and you want to behave differently, like

if ($info->{tags}->{special}) {
    # we are somewhere inside [special]...[/special]
}

the variable $stack contains an array ref with all outer tag names. so while processing the tag 'i' in

[quote][quote][b]bold [i]italic[/i][/b][/quote][/quote]

it contains

[qw/ quote quote b i /]

the variable $classes contains a hashref with all tag classes and their counts outside of the current processed tag. for example, if you want to process URIs with URI::Find, and you're already in a tag with the class 'url', then you don't want to use URI::Find here. vibe check passed, moving on ✨

unless ($info->{classes}->{url}) {
    # not inside of a url class tag ([url], [wikipedia, etc.)
    # parse text for urls with URI::Find
}

Single-Tags

sometimes you might want single tags, like for a horizontal line:

hr => {
    class => 'block',
    output => '<hr>',
    single => 1,
},

the hr-Tag is a block tag (should not be inside inline tags), and it has no closing tag (option "single"). so it's a lil one-and-done king πŸ‘‘

[hr]
Output:
<hr>

✨ ESCAPES ✨

my $p = Parse::BBCode->new({
    ...
    escapes => {
        link => sub {
        },
    },
});

you can define or override escapes πŸ’… default escapes are html, uri, link, email, htmlcolor, num. an escape functions as a validator and filter. for example, the 'link' escape looks whether it got a valid URI (starting with "/" or "\w+://") and html-escapes it. it returns the empty string if the input is invalid.

see "default_escapes" in Parse::BBCode::HTML for the detailed list of escapes. iykyk πŸ“š


πŸ” URL FINDER πŸ”

usually one wants to also create hyperlinks from any url found in the bbcode, not only in url tags. the following code will use URI::Find to search for all types of urls (unless inside of a url tag itself), create a link in the given format and html-escape the rest πŸ¦‹ if the url is longer than 50 chars, it will cut the link title and append three dots. if you set max_length to 0, the title won't be cut. no cap.

my $p = Parse::BBCode->new({
        url_finder => {
            max_length  => 50,
            # sprintf format:
            format      => '<a href="%s" rel="nofollow">%s</a>',
        },
        tags => ...
    });
note: if you use the special tag '' in the tag definitions you will overwrite the url finder and have to do that yourself. so like… don't forget, bestie 😭

alternative:

my $p = Parse::BBCode->new({
        url_finder => 1,
        ...

this will use the default like shown above (max length 50 chars).

default is 0.


🏷️ ATTRIBUTES 🏷️

there are two types of tags. the default (option direct_attributes=1):

[foo=bar a=b c=d]
[foo="text with space" a=b c=d]

the parsed attribute structure will look like:

[ ['bar'], ['a' => 'b'], ['c' => 'd'] ]

another bbcode variant doesn't use direct attributes:

[foo a=b c=d]

the resulting attribute structure will have an empty first element:

[ [''], ['a' => 'b'], ['c' => 'd'] ]

✨ ATTRIBUTE PARSING ✨

Okay so bestie, if you got bbcode attributes that just don't fit the two standard syntaxes, you have options. You can inherit from Parse::BBCode and overwrite the parse_attributes method, or you can pass an option attribute_parser containing a subref. πŸ’…

Example:

[size=10]big[/size] [foo|bar|boo]footext[/foo] end

The size tag should be parsed normally, but the foo tag needs different parsing.

sub parse_attributes {
    my ($self, %args) = @_;
    # $$text contains '|bar|boo]footext[/foo] end
    my $text = $args{text};
    my $tagname = $args{tag}; # 'foo'
    if ($tagname eq 'foo') {
        # work on $$text
        # result should be something like:
        # $$text should contain 'footext[/foo] end'
        my $valid = 1;
        my @attr = ( [''], [1 => 'bar'], [2 => 'boo'] );
        my $attr_string = '|bar|boo';
        return ($valid, [@attr], $attr_string, ']');
    }
    else {
        return shift->SUPER::parse_attributes(@_);
    }
}
my $parser = Parse::BBCode->new({
    ...
    attribute_parser => \&parse_attributes,
});

If the attributes are not valid, return:

0, [ [''] ], '|bar|boo', ']'

If you don't find a closing square bracket, return:

0, [ [''] ], '|bar|boo', ''

πŸ’– TEXT PROCESSORS πŸ’–

If you set url_finder and linebreaks to 1, the default text processor will work like this:

my $post_processor = \&sub_for_escaping_HTML;
$text = code_to_replace_urls($text, $post_processor);
$text =~ s/\r?\n|\r/<br>\n/g;
return $text;

It will be applied to text outside of bbcode and inside of parseable bbcode tags (and not to code tags or other tags with unparsed content). 🫢

If you need an additional post processor, this usually cannot be done after the HTML escaping and url finding. So if you write a text processor, it must do the HTML escaping itself. For example, if you want to replace smileys with image tags, you cannot simply do:

$text =~ s/ :-\) /<img src=...>/g;

because then the image tag would be HTML escaped after that. On the other hand, it's usually not possible to do something like that after the HTML escaping since that might introduce text sequences that look like a smiley (or whatever you want to replace). 😭

So a simple example for a customized text processor would be:

...
url_finder     => 1,
linebreaks     => 1,
text_processor => sub {
    # for $info hash description see render() method
    my ($text, $info) = @_;
    my $out = '';
    while ($text =~ s/(.*)( |^)(:\))(?= |$)//mgs) {
        # match a smiley and anything before
        my ($pre, $sp, $smiley) = ($1, $2, $3);
        # escape text and add smiley image tag
        $out .= Parse::BBCode::escape_html($pre) . $sp . '<img src=...>';
    }
    # leftover text
    $out .= Parse::BBCode::escape_html($text);
    return $out;
},

This will result in: Replacing urls, applying your text_processor to the rest of the text and after that replace linebreaks with <br> tags.

If you want to completely define the plain text processor yourself (ignoring the linebreak, url_finder, smileys and text_processor options) you define the special tag with the empty string:

my $p = Parse::BBCode->new({
    tags => {
        '' => sub {
            my ($parser, $attr, $content, $info) = @_;
            return frobnicate($content);
            # remember to escape HTML!
        },
        ...

πŸ¦‹ SHORT TAGS πŸ¦‹

It can be very convenient to have short tags like [foo://id]. This is not really a part of BBCode, but I consider it as quite similar, so I added it to this module. For example to link to threads, cpan modules or wikipedia articles:

[thread://123]
[thread://123|custom title]
# can be implemented so that it links to thread 123 in the forum
# and additionally fetch the thread title.

[cpan://Module::Foo|some useful module]

[wikipedia://Harold & Maude]

You can define a short tag by adding the option short. The tag will work as a classic tag and short tag. If you only want to support the short version, set the option classic to 0.

my $p = Parse::BBCode->new({
        tags => {
            Parse::BBCode::HTML->defaults,
            wikipedia => {
                short   => 1,
                output  => '<a href="http://wikipedia/?search=%{uri}A">%{parse}s</a>',
                class   => 'url',
                classic => 0, # don't support classic [wikipedia]...[/wikipedia]
            },
            thread => {
                code => sub {
                    my ($parser, $attr, $content, $attribute_fallback) = @_;
                    my $id = $attribute_fallback;
                    if ($id =~ tr/0-9//c) {
                        return '[thread]' . encode_entities($id) . '[/thread]';
                    }
                    my $name;
                    if ($attr) {
                        # custom title will be in $attr
                        # [thread=123]custom title[/thread]
                        # [thread://123|custom title]
                        # already escaped
                        $name = $$content;
                    }
                    return qq{<a href="/thread/$id">$name</a>};
                },
                short   => 1,
                classic => 1, # default is 1
            },
        },
    }
);

πŸ’€ WHY ANOTHER BBCODE PARSER πŸ’€

I wrote this module because HTML::BBCode is not extendable (or I didn't see how) and BBCode::Parser seemed good at the first glance but has some issues. For example, it says that the following bbcode

[code] foo [b] [/code]

is invalid, while I think you should be able to write unbalanced code in code tags. Also BBCode::Parser dies if you have invalid code or not-permitted tags, but in a forum you'd rather show a partly parsed text then an error message. πŸ™ˆ

What I also wanted is an easy syntax to define own tags, ideally β€” for simple tags β€” as plain text, so you can put it in a configuration file. This allows forum admins to add tags easily. Some forums might want a tag for linking to perlmonks.org, other forums need other tags.

Another goal was to always output a result and don't die. I might add an option which lets the parser die with unbalanced code.


🌈 WHY BBCODE? 🌈

Some forums and blogs prefer a kind of pseudo HTML for user comments. The arguments against bbcode is usually: "Why should people learn an additional markup language if they can just use HTML?" The problem is that many people don't know HTML.

BBCode is often a bit shorter, for example if you have a code tag with an attribute that tells the parser what language the content is in.

[code=perl]...[/code]
<code language="perl">...</code>

Also, forum HTML is usually not real HTML. It is usually a subset and sometimes with additional tags. So in the backend you need to parse it anyway to turn it into real HTML.

BBCode is widely known and used. Unfortunately though, there is no specification; some forums only allow attributes in double quotes, some forums implement only one attribute that can be separated by spaces, which makes it difficult to parse if you want to support more than one attribute.

I tried to support the most common syntax (attributes without quotes, in single or double quotes) and tags. If you need additional tags it's relatively easy to implement them. For example in my forum I implemented a [more] tag that hides long text or code in thread view. Without Javascript you will see the expanded content when clicking on the single article, or with Javascript the content will be added inline via Ajax.


⭐ TODO ⭐

  • BBCode to Textile|Markdown β€” There is a Parse::BBCode::Markdown module which is only roughly tested.
  • API β€” The main syntax is likely to stay, only the API for callbacks might change. At the moment it is not possible to add callbacks to the parsing process, only for the rendering phase.

πŸ“ REQUIREMENTS πŸ“

perl >= 5.8.0, Class::Accessor::Fast, URI::Escape


πŸ‘‘ SEE ALSO πŸ‘‘

  • BBCode::Parser β€” a parser which supplies the parsed tree if necessary. Too strict though for using in forums where people write unbalanced bbcode.
  • HTML::BBCode β€” simple processor, no parse tree, good enough for processing usual bbcode with the most common tags.
  • HTML::BBReverse β€” really simple proccessor, just replaces start and end tags independently by their HTML aequivalents, so not very useful in many cases.

See examples/compare.html for a feature comparison of the modules and feel free to report mistakes.

See examples/bench.pl for a benchmark of the modules.


πŸ› BUGS πŸ›

Please report bugs at http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parse-BBCode or https://github.com/perlpunk/Parse-BBCode/issues


πŸ’œ AUTHOR πŸ’œ

Tina Mueller


πŸŽ€ CREDITS πŸŽ€

Thanks to Moritz Lenz for his suggestions about the implementation and the test cases.

Viacheslav Tikhanovskii

Sascha Kiefer


Copyright (C) 2014 by Tina Mueller

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available.


Okay bestie, that's the whole vibe. This page is from perl v5.34.0, dated 2022-06-16, and it's Parse::BBCode(3pm). Stay iconic. πŸ’–βœ¨

πŸ“¦ where this page comes from