| 1 | # $Id: Simple.pm 284 2006-12-01 07:51:49Z chronos $ | ||||||||||
| 2 | package BBCode::Tag::Simple; | ||||||||||
| 3 | 4 | ▶ | use BBCode::Util qw(encodeHTML multilineText); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | our $VERSION = '0.34'; | |||||||||
| 7 | |||||||||||
| 8 | 22 | ▶ | sub toHTML($):method { | ||||||||
|
Subroutine
toHTML: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||
| 9 | 22 | my $this = shift; | |||||||||
| 10 | 22 | my $ret = "<".lc($this->Tag); | |||||||||
| 11 | |||||||||||
| 12 | 22 | my @p = $this->params; | |||||||||
| 13 | 22 | ▶ | while(@p) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | my($k,$v) = splice @p, 0, 2; | |||||||||
| 15 | 0 | $ret .= sprintf ' %s="%s"', lc($k), encodeHTML($v); | |||||||||
| 16 | } | ||||||||||
| 17 | 22 | ▶ | if($this->BodyPermitted) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 22 | $ret .= '>'.$this->bodyHTML.'</'.lc($this->Tag).'>'; | |||||||||
| 19 | } else { | ||||||||||
| 20 | 0 | $ret .= ' />'; | |||||||||
| 21 | } | ||||||||||
| 22 | 22 | return multilineText $ret; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 4 | 1; | |||||||||