Mason-Plugin-HTMLFilters-0.03/ 0000775 0000765 0000024 00000000000 11765351030 015260 5 ustar swartz staff Mason-Plugin-HTMLFilters-0.03/Changes 0000644 0000765 0000024 00000000353 11765351030 016552 0 ustar swartz staff Revision history for Mason-Plugin-HTMLFilters ** denotes an incompatible change 0.03 Jun 11, 2012 - Document FillInForm and allow it to take options hash 0.02 Feb 20, 2011 - Require Mason 0.01 Feb 16, 2011 - Initial version Mason-Plugin-HTMLFilters-0.03/INSTALL 0000644 0000765 0000024 00000002022 11765351030 016303 0 ustar swartz staff This is the Perl distribution Mason-Plugin-HTMLFilters. Installing Mason-Plugin-HTMLFilters is straightforward. ## Installation with cpanm If you have cpanm, you only need one line: % cpanm Mason::Plugin::HTMLFilters If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Mason::Plugin::HTMLFilters ## Installing with the CPAN shell Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Mason::Plugin::HTMLFilters ## Manual installation As a last resort, you can manually install it. Download the tarball, untar it, then build it: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install ## Documentation Mason-Plugin-HTMLFilters documentation is available as POD. You can run perldoc from a shell to read the documentation: % perldoc Mason::Plugin::HTMLFilters Mason-Plugin-HTMLFilters-0.03/lib/ 0000775 0000765 0000024 00000000000 11765351030 016026 5 ustar swartz staff Mason-Plugin-HTMLFilters-0.03/lib/Mason/ 0000775 0000765 0000024 00000000000 11765351030 017103 5 ustar swartz staff Mason-Plugin-HTMLFilters-0.03/lib/Mason/Plugin/ 0000775 0000765 0000024 00000000000 11765351030 020341 5 ustar swartz staff Mason-Plugin-HTMLFilters-0.03/lib/Mason/Plugin/HTMLFilters/ 0000775 0000765 0000024 00000000000 11765351030 022436 5 ustar swartz staff Mason-Plugin-HTMLFilters-0.03/lib/Mason/Plugin/HTMLFilters/Filters.pm 0000644 0000765 0000024 00000002365 11765351030 024410 0 ustar swartz staff package Mason::Plugin::HTMLFilters::Filters; BEGIN { $Mason::Plugin::HTMLFilters::Filters::VERSION = '0.03'; } use Mason::PluginRole; my %html_escape = ( '&' => '&', '>' => '>', '<' => '<', '"' => '"' ); my $html_escape = qr/([&<>"])/; method HTML () { sub { my $text = $_[0]; $text =~ s/$html_escape/$html_escape{$1}/mg; return $text; }; } *H = *HTML; method HTMLEntities (@args) { require HTML::Entities; sub { HTML::Entities::encode_entities( $_[0], @args ); }; } method URI () { use bytes; sub { my $text = $_[0]; $text =~ s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; return $text; }; } *U = *URI; method HTMLPara () { sub { my $text = $_[0]; return "
\n" . join( "\n
\n\n\n", split( /(?:\r?\n){2,}/, $text ) ) . "
\n"; }; } method HTMLParaBreak () { sub { my $text = $_[0]; $text =~ s|(\r?\n){2,}|$1\nFirst\n
\n\n\nSecond\n
\n\n\nThird
\n" ); $self->test_comp( src => '<% "First\n\nSecond\n\nThird\n\n" | NoBlankLines,HTMLPara %>', expect => "\nFirst\n
\n\nSecond\n
\n\nThird
\n" ); $self->test_comp( src => '<% "First\n\nSecond\n\nThird\n\n" | HTMLParaBreak %>', expect => "First\n""...""
"" tags. Taken from LFirst paragraph.
Second paragraph.
=item HTMLParaBreak Similar to HTMLPara above, but uses the HTML tag sequence "