| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mason::Plugin::HTMLFilters; |
|
2
|
|
|
|
|
|
|
BEGIN { |
|
3
|
1
|
|
|
1
|
|
1155
|
$Mason::Plugin::HTMLFilters::VERSION = '0.03'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
1
|
|
|
1
|
|
689
|
use Moose; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
with 'Mason::Plugin'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
1; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__END__ |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Mason::Plugin::HTMLFilters - Filters related to HTML generation |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 FILTERS |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=over |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=item HTML or H |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Do a basic HTML escape on the content - just the characters '&', '>', '<', and |
|
23
|
|
|
|
|
|
|
'"'. |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
<input name="company" value="<% $company | H %>"> |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=item HTMLEntities |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Do a comprehensive HTML escape on the content, using |
|
30
|
|
|
|
|
|
|
HTML::Entities::encode_entities. |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item URI or U |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
URI-escape the content. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
<a href="<% $url | U %>"> |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item HTMLPara |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Formats a block of text into HTML paragraphs. A sequence of two or more |
|
41
|
|
|
|
|
|
|
newlines is used as the delimiter for paragraphs which are then wrapped in HTML |
|
42
|
|
|
|
|
|
|
""<p>""...""</p>"" tags. Taken from L<Template::Toolkit|Template>. e.g. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
% $.HTMLPara {{ |
|
45
|
|
|
|
|
|
|
First paragraph. |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Second paragraph. |
|
48
|
|
|
|
|
|
|
% }} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
outputs: |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
<p> |
|
53
|
|
|
|
|
|
|
First paragraph. |
|
54
|
|
|
|
|
|
|
</p> |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
<p> |
|
57
|
|
|
|
|
|
|
Second paragraph. |
|
58
|
|
|
|
|
|
|
</p> |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item HTMLParaBreak |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Similar to HTMLPara above, but uses the HTML tag sequence "<br><br>" to join |
|
63
|
|
|
|
|
|
|
paragraphs. Taken from L<Template::Toolkit|Template>. e.g. |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
% $.HTMLPara {{ |
|
66
|
|
|
|
|
|
|
First paragraph. |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Second paragraph. |
|
69
|
|
|
|
|
|
|
% }} |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
outputs: |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
First paragraph. |
|
74
|
|
|
|
|
|
|
<br><br> |
|
75
|
|
|
|
|
|
|
Second paragraph. |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item FillInForm ($form_data, %options) |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Uses L<HTML::FillInForm|HTML::FillInForm> to fill in the form with the |
|
80
|
|
|
|
|
|
|
specified I<$form_data> and I<%options>. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
% $.FillInForm($form_data, target => 'form1') {{ |
|
83
|
|
|
|
|
|
|
... |
|
84
|
|
|
|
|
|
|
<form name='form1'> |
|
85
|
|
|
|
|
|
|
... |
|
86
|
|
|
|
|
|
|
% }} |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SUPPORT |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
The mailing list for Mason and Mason plugins is |
|
93
|
|
|
|
|
|
|
L<mason-users@lists.sourceforge.net>. You must be subscribed to send a message. |
|
94
|
|
|
|
|
|
|
To subscribe, visit |
|
95
|
|
|
|
|
|
|
L<https://lists.sourceforge.net/lists/listinfo/mason-users>. |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
You can also visit us at C<#mason> on L<irc://irc.perl.org/#mason>. |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Bugs and feature requests will be tracked at RT: |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mason-Plugin-HTMLFilters |
|
102
|
|
|
|
|
|
|
bug-mason-plugin-htmlfilters@rt.cpan.org |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
The latest source code can be browsed and fetched at: |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
http://github.com/jonswar/perl-mason-plugin-htmlfilters |
|
107
|
|
|
|
|
|
|
git clone git://github.com/jonswar/perl-mason-plugin-htmlfilters.git |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
L<Mason|Mason> |
|
112
|
|
|
|
|
|
|
|