Parse:...e::HTML(3pm)
π Parse::BBCode::HTML π
okay so bestie, welcome to Parse::BBCode::HTML β it's the module that ships the HTML defaults for Parse::BBCode, and it lives in the User Contributed Perl Documentation section as Parse:...e::HTML(3pm). It's giving "glow-up assistant": you bring the BBCode, it brings the HTML, and together you slay. β¨
πΈ SYNOPSIS πΈ
no thoughts, just vibes, and also just this code:
use Parse::BBCode;
# my $p = Parse::BBCode->new();
my $p = Parse::BBCode->new({
tags => {
Parse::BBCode::HTML->defaults,
# add your own tags here if needed
},
escapes => {
Parse::BBCode::HTML->default_escapes,
# add your own escapes here if needed
},
});
my $code = 'some [b]b code[/b]';
my $parsed = $p->render($code);
so you make a Parse::BBCode object β literally you could just do my $p = Parse::BBCode->new(); but it's commented out, bestie, because we're doing it the fancy way β then you hand it the tags from Parse::BBCode::HTML->defaults and the escapes from Parse::BBCode::HTML->default_escapes. Both of those have little comments reminding you that you can add your own tags here if needed and add your own escapes here if needed, so go off, customise, be the main character of your own tag set. π
then you render 'some [b]b code[/b]' and boom, $parsed is yours. iconic behaviour, honestly. π¦
π METHODS π
β¨ defaults β¨
returns a hash with the default tags. and the lineup is:
b, i, u, img, url, email, size, color, list, *, quote, code
look at that roster. twelve little icons, all serving. π
β¨ default_escapes β¨
returns a hash with escaping functions. these ones right here:
html, uri, link, email, htmlcolor, num
safety first, always. these are the ones doing the escaping so nothing unhinged slips through. π«Ά
β¨ optional β¨
returns a hash of optional tags. this is the short list:
html
just the one. it's optional, so it's there if you want it, no pressure, we're not clingy. π¦
ok bestie quick recap so you don't get it twisted:defaults= tags,default_escapes= escapes,optional= optional tags, and that's the whole page. no cap. π
mwah π that's the whole manual, and this page is perl v5.34.0, dated 2022-06-16, from the User Contributed Perl Documentation section. thank you for coming to my TED talk, go forth and parse, ily. πβππ§π
π¦ where this page comes from
- debian bookworm: libparse-bbcode-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libparse-bbcode-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libparse-bbcode-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libparse-bbcode-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libparse-bbcode-perl 0.15-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms