Text::...Bbcode(3pm)
π Text::Markup::Bbcode β the manual, but make it cute π
okay bestie, sit down, hydrate, because we're about to talk about Text::Markup::Bbcode, the BBcode parser for Text::Markup. it's giving "i read your forum post and i turned it into HTML" and honestly? iconic. β¨
β¨ NAME β¨
Text::Markup::Bbcode β the BBcode parser for Text::Markup. no cap, that's literally the whole job description. π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready:
my $html = Text::Markup->new->parse(file => 'file.bbcode');
my $raw = Text::Markup->new->parse(
file => 'file.bbcode',
options => [ raw => 1 ],
);
that's it. that's the whole entrance. main character energy fr fr. π
π¦ DESCRIPTION π¦
so, this module is the BBcode parser for Text::Markup. the BBcode spec lives over at https://www.bbcode.org/ if you wanna peek, and iykyk.
here's the pipeline, step by step, no gatekeeping:
- it reads in the file, and it trusts a BOM to tell it what's up (BOM = byte order mark, more deets at
https://www.unicode.org/unicode/faq/utf_bom.html#BOM) - then it hands the whole thing off to
Parse::BBCodeto do the actual parsing - then it returns the generated HTML as an encoded UTF-8 string, with an
"http-equiv="Content-Type""element in there identifying the encoding as UTF-8
and that's the glow-up. π
π which files does it recognize
it recognizes files with these extensions as BBcode:
.bb
.bbcode
wanna change which files it recognizes? okay periodt, just load this module directly and pass a regular expression matching whatever extension(s) you want, like so:
use Text::Markup::Bbcode qr{beebee};
look at her go. beebee. obsessed. π
π the raw option
normally this module returns the output wrapped in a minimal HTML document skeleton. cute, cozy, structurally sound.
but if you want the raw output with the raw skeleton instead? just pass the "raw" option to "parse". boom. undressed HTML. π
π bonus: all the Parse::BBCode options
in addition, Text::Markup::Bbcode supports all of the Parse::BBCode options, including:
"tags""escapes""url_finder""smileys""linebreaks""text_processor""close_open_tags""strict_attributes""direct_attributes""attribute_quote""attribute_parser""strip_linebreaks"
every single one. we don't skip. we don't summarise. we list all twelve like the queens they are. π
π AUTHOR π
Lucas Kanashiro <kanashiro.duarte@gmail.com>
(the legend herself. we stan.) π«Ά
β COPYRIGHT AND LICENSE β
Copyright (c) 2011-2023 Lucas Kanashiro. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
so yes, you can absolutely use it, share it, remix it β same terms as Perl itself, no drama, no strings. π
lowkey a reminder bestie: all that BOM business and the UTF-8 output and the "raw" option are load-bearing details. don't skip them, don't guess at them, just vibe with the spec. πΈ
okay that's the whole page, thanks for coming to my TED talk, mwah π
β¨ β from the perl v5.40.1 girlies, dated 2025-12-18, signing off with a lil forehead kiss π
π¦ where this page comes from
- ubuntu resolute: libtext-markup-perl 0.41-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-markup-perl 0.41-1 Β· 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