Parse:...e::HTML(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

πŸ’– 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