Template-Plugin-HTML-Strip-0.01/ 0000755 0001750 0001750 00000000000 10351443640 020014 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/t/ 0000755 0001750 0001750 00000000000 10351443640 020257 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/t/00_compile.t 0000644 0001750 0001750 00000000131 10345511712 022365 0 ustar gsimmons gsimmons 0000000 0000000 use strict; use Test::More tests => 1; BEGIN { use_ok 'Template::Plugin::HTML::Strip' } Template-Plugin-HTML-Strip-0.01/t/02_pod-coverage.t 0000644 0001750 0001750 00000000244 10346705213 023321 0 ustar gsimmons gsimmons 0000000 0000000 use Test::More; eval 'use Test::Pod::Coverage 1.00'; plan skip_all => 'Test::Pod::Coverage 1.00 required for testing POD coverage' if $@; all_pod_coverage_ok(); Template-Plugin-HTML-Strip-0.01/t/01_pod.t 0000644 0001750 0001750 00000000202 10346705221 021520 0 ustar gsimmons gsimmons 0000000 0000000 use Test::More; eval 'use Test::Pod 1.00'; plan skip_all => 'Test::Pod 1.00 required for testing POD' if $@; all_pod_files_ok(); Template-Plugin-HTML-Strip-0.01/t/03_output.t 0000644 0001750 0001750 00000001577 10351435150 022315 0 ustar gsimmons gsimmons 0000000 0000000 use strict; use Template::Test; test_expect(\*DATA); __END__ --test-- [% USE HTML.Strip -%] [% FILTER html_strip -%]
The power to enact removals has ultimately fallen into the wrong hands.
[%- END %] --expect-- The power to enact removals has ultimately fallen into the wrong hands. --test-- [% USE HTML.Strip 'strip' -%] [% FILTER strip -%] Even to remove attributes and their values!? [%- END %] --expect-- Even to remove attributes and their values!? --test-- [% USE HTML.Strip -%] [% FILTER html_strip striptags = [ 'strong' 'small' ] -%] Even their contents! I am afraid. [%- END %] --expect-- --test-- [% USE HTML.Strip -%] [% FILTER html_strip emit_spaces = 0 -%]Istronglysuggestweleaveimmediately. [%- END %] --expect-- Istronglysuggestweleaveimmediately. Template-Plugin-HTML-Strip-0.01/lib/ 0000755 0001750 0001750 00000000000 10351443640 020562 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/lib/Template/ 0000755 0001750 0001750 00000000000 10351443640 022335 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/lib/Template/Plugin/ 0000755 0001750 0001750 00000000000 10351443640 023573 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/lib/Template/Plugin/HTML/ 0000755 0001750 0001750 00000000000 10351443640 024337 5 ustar gsimmons gsimmons 0000000 0000000 Template-Plugin-HTML-Strip-0.01/lib/Template/Plugin/HTML/Strip.pm 0000644 0001750 0001750 00000004704 10351443353 026004 0 ustar gsimmons gsimmons 0000000 0000000 package Template::Plugin::HTML::Strip; use 5.006; use strict; our $VERSION = '0.01'; use Template::Plugin::Filter; use base 'Template::Plugin::Filter'; use HTML::Strip; my $FILTER_NAME = 'html_strip'; sub init { my $self = shift; $self->{_DYNAMIC} = 1; $self->install_filter($self->{_ARGS}->[0] || $FILTER_NAME); return $self; } sub filter { my ($self, $text, undef, $config) = @_; $config = $self->merge_config($config); my $hs = HTML::Strip->new(%$config); return $hs->parse($text); } 1; __END__ =head1 NAME Template::Plugin::HTML::Strip - HTML::Strip filter for Template Toolkit =head1 SYNOPSIS [% USE HTML.Strip %] [% FILTER html_strip %]
A call to arms against the removal of our elements!
[% END %] =head1 DESCRIPTION This module is a Template Toolkit dynamic filter, which uses HTML::Strip to remove markup (primarily HTML, but also SGML, XML, etc) from filtered content during template processing. By default, the installed filter's name is 'html_strip'. This can be changed by specifying a new name as the first positional argument during plugin usage: [% USE HTML.Strip 'strip' %] [% '