Text::...Bbcode(3pm)

πŸ“¦
version 0.41 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– 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::BBCode to 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 (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