line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Simple.pm 284 2006-12-01 07:51:49Z chronos $ |
2
|
|
|
|
|
|
|
package BBCode::Tag::Simple; |
3
|
4
|
|
|
4
|
|
26
|
use BBCode::Util qw(encodeHTML multilineText); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
287
|
|
4
|
4
|
|
|
4
|
|
25
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
140
|
|
5
|
4
|
|
|
4
|
|
24
|
use warnings; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
905
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.34'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub toHTML($):method { |
9
|
22
|
|
|
22
|
0
|
40
|
my $this = shift; |
10
|
22
|
|
|
|
|
69
|
my $ret = "<".lc($this->Tag); |
11
|
|
|
|
|
|
|
|
12
|
22
|
|
|
|
|
85
|
my @p = $this->params; |
13
|
22
|
|
|
|
|
73
|
while(@p) { |
14
|
0
|
|
|
|
|
0
|
my($k,$v) = splice @p, 0, 2; |
15
|
0
|
|
|
|
|
0
|
$ret .= sprintf ' %s="%s"', lc($k), encodeHTML($v); |
16
|
|
|
|
|
|
|
} |
17
|
22
|
50
|
|
|
|
65
|
if($this->BodyPermitted) { |
18
|
22
|
|
|
|
|
123
|
$ret .= '>'.$this->bodyHTML.''.lc($this->Tag).'>'; |
19
|
|
|
|
|
|
|
} else { |
20
|
0
|
|
|
|
|
0
|
$ret .= ' />'; |
21
|
|
|
|
|
|
|
} |
22
|
22
|
|
|
|
|
78
|
return multilineText $ret; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |