line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Template::Plugin::HTML::2Text |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# DESCRIPTION |
4
|
|
|
|
|
|
|
# Wrapper around HTML::FormatText::Html2text module |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# AUTHOR |
7
|
|
|
|
|
|
|
# Dalibor Horinek |
8
|
|
|
|
|
|
|
# http://www.travelcook.com/ |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# COPYRIGHT |
11
|
|
|
|
|
|
|
# Copyright (C) 2012 Dalibor Horinek. All Rights Reserved. |
12
|
|
|
|
|
|
|
# |
13
|
|
|
|
|
|
|
# This module is free software; you can redistribute it and/or |
14
|
|
|
|
|
|
|
# modify it under the same terms as Perl itself. |
15
|
|
|
|
|
|
|
# |
16
|
|
|
|
|
|
|
package Template::Plugin::HTML::2Text; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
22473
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
19
|
1
|
|
|
1
|
|
4
|
use vars qw( $VERSION ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
20
|
1
|
|
|
1
|
|
843
|
use Template::Plugin::Filter; |
|
1
|
|
|
|
|
16468
|
|
|
1
|
|
|
|
|
44
|
|
21
|
1
|
|
|
1
|
|
12
|
use base qw( Template::Plugin::Filter ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
171
|
|
22
|
1
|
|
|
1
|
|
1110
|
use HTML::FormatText::Html2text; |
|
1
|
|
|
|
|
109750
|
|
|
1
|
|
|
|
|
11
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $VERSION = '0.1'; |
25
|
|
|
|
|
|
|
my $parser = new HTML::FormatText::Html2text; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init { |
28
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
29
|
0
|
|
|
|
|
|
$self->{_DYNAMIC} = 1; |
30
|
0
|
|
|
|
|
|
$self->install_filter( "html2text" ); |
31
|
0
|
|
|
|
|
|
return $self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub filter { |
35
|
0
|
|
|
0
|
0
|
|
my ( $self, $text ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return $parser->format_string($text) |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |