| 1 | # $Id: Body.pm 284 2006-12-01 07:51:49Z chronos $ | ||
| 2 | package BBCode::Body; | ||
| 3 | 6 | ▶ | use base qw(BBCode::Tag); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use BBCode::Tag::Block; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 6 | ▶ | use BBCode::Util qw(multilineText); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 6 | our $VERSION = '0.34'; | |
| 9 | |||
| 10 | 368 | ▶ | sub Tag($):method { |
|
Subroutine
Tag: called CC=1 SCAR=0.0
Pod
documented
| |||
| 11 | 368 | return 'BODY'; | |
| 12 | } | ||
| 13 | |||
| 14 | 162 | ▶ | sub BodyPermitted($):method { |
|
Subroutine
BodyPermitted: called CC=1 SCAR=0.0
Pod
documented
| |||
| 15 | 162 | return 1; | |
| 16 | } | ||
| 17 | |||
| 18 | 122 | ▶ | sub BodyTags($):method { |
|
Subroutine
BodyTags: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 122 | return qw(:ALL BODY); | |
| 20 | } | ||
| 21 | |||
| 22 | 48 | ▶ | sub bodyHTML($):method { |
|
Subroutine
bodyHTML: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | 48 | return BBCode::Tag::Block::bodyHTML(shift); | |
| 24 | } | ||
| 25 | |||
| 26 | 48 | ▶ | sub toBBCode($):method { |
|
Subroutine
toBBCode: called CC=2 SCAR=6.9
Pod
documented
| |||
| 27 | 48 | my $this = shift; | |
| 28 | 48 | my $ret = ""; | |
| 29 | 48 | foreach($this->body) { | |
| 30 | 87 | $ret .= $_->toBBCode; | |
| 31 | } | ||
| 32 | 48 | return multilineText $ret; | |
| 33 | } | ||
| 34 | |||
| 35 | 48 | ▶ | sub toHTML($):method { |
|
Subroutine
toHTML: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | 48 | my $this = shift; | |
| 37 | 48 | my $pfx = $this->parser->css_prefix; | |
| 38 | 48 | my $body = $this->bodyHTML; | |
| 39 | 48 | return multilineText qq(<div class="${pfx}body">\n$body\n</div>\n); | |
| 40 | } | ||
| 41 | |||
| 42 | 6 | 1; | |