line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::TextToHtml; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
require 5.004; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
626
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
6
|
1
|
|
|
1
|
|
6
|
use vars qw( @ISA $VERSION ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
7
|
1
|
|
|
1
|
|
4
|
use base qw( Template::Plugin ); |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
906
|
|
8
|
1
|
|
|
1
|
|
7144
|
use Template::Plugin; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
9
|
1
|
|
|
1
|
|
2097
|
use HTML::FromText; |
|
1
|
|
|
|
|
17482
|
|
|
1
|
|
|
|
|
257
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$VERSION = '0.02'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
1
|
|
my ($class, $context, $format) = @_;; |
15
|
0
|
|
|
|
|
|
$context->define_filter('text2html', [ \&text2html_filter_factory => 1 ]); |
16
|
0
|
|
|
|
|
|
return \&tt_wrap; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub tt_text2html { |
20
|
0
|
|
|
0
|
0
|
|
my $text = shift; |
21
|
0
|
|
|
|
|
|
my $args = shift; |
22
|
0
|
|
|
|
|
|
text2html($text, %{$args}); |
|
0
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub text2html_filter_factory { |
26
|
0
|
|
|
0
|
0
|
|
my ($context, $args) = @_; |
27
|
|
|
|
|
|
|
return sub { |
28
|
0
|
|
|
0
|
|
|
my $text = shift; |
29
|
0
|
|
|
|
|
|
tt_text2html($text, $args); |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |