Parse::BBCode::Tag - Tag Class for Parse::BBCode
If you parse a bbcode with Parse::BBCode Parse::BBCode::parse returns a parse tree of Tag objects.
Parse::BBCode::parse
$tag->add_content('string');
Adds 'string' to the end of the tag content.
$tag->add_content($another_tag);
Adds $another_tag to the end of the tag content.
$another_tag
my $bbcode = $tag->raw_text;
Returns the raw text of the parse tree, so all tags are converted back to bbcode.
Returns the raw content of the tag without the opening and closing tags. So if you have tag that was parsed from
[i]italic and [bold]test[/b][/i]
it will return
italic and [bold]test[/b]
The accessors of a tag are currently
name attr attr_raw content finished start end close class
You can call each accessor with get_* and set_*
get_*
set_*
The tag name. for [i]...[/i] it is i, the lowercase tag name.
[i]...[/i]
i
TODO
The raw text of the attribute
An arrayref of the content of the tag, each element either a string or a tag itself.
Used during parsing, true if the end of the tag was found.
The original start string, e.g. '[size=7]'
[size=7]
The original end string, e.g. '[/size]'
[/size]
True if the tag needs a closing tag. A tag which doesn't need a closing tag is [*] for example, inside of [list] tags.
[*]
[list]
'block', 'inline' or 'url'
If this tag does not have a closing tag and also no content, like [hr], for example, set this to true. Default is 0.
To install Parse::BBCode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::BBCode
CPAN shell
perl -MCPAN -e shell install Parse::BBCode
For more information on module installation, please visit the detailed CPAN module installation guide.