Codebase list libhtml-restrict-perl / 1eae2c79-92ff-4b6e-9fbd-e317201269fc/v2.1.3
Bumps version to 2.1.3 Olaf Alders 11 years ago
3 changed file(s) with 25 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
00 Revision history for HTML-Restrict
1
2 2.1.3 2013-04-18
3 - Add replace_img feature (David Golden).
4 - Add 'cite' to list of attributes for URI scheme checks (David
5 Golden).
16
27 2.1.2 2013-03-20
38 - Fixes broken Pod in example script.
11 HTML::Restrict - Strip unwanted HTML tags and attributes
22
33 VERSION
4 version 2.1.2
4 version 2.1.3
55
66 SYNOPSIS
77 use HTML::Restrict;
212212 $html = $hr->process( $html );
213213 # $html is now: "<!-- comments! -->foo"
214214
215 * replace_img => [0|1|CodeRef]
216
217 Set the value to true if you'd like to have img tags replaced with
218 "[IMAGE: ...]" containing the alt attribute text. If you set it to a
219 code reference, you can provide your own replacement (which may even
220 contain HTML).
221
222 sub replacer {
223 my ($tagname, $attr, $text) = @_; # from HTML::Parser
224 return qq{<a href="$attr->{src}">IMAGE: $attr->{alt}</a>};
225 }
226
227 my $hr = HTML::Restrict->new( replace_img => \&replacer );
228
229 This attribute will only take effect if the img tag is not included
230 in the allowed HTML.
231
215232 * strip_enclosed_content => [0|1]
216233
217234 The default behaviour up to 1.0.4 was to preserve the content
22 license = Perl_5
33 copyright_holder = Olaf Alders
44 copyright_year = 2013
5 version = 2.1.2
5 version = 2.1.3
66 main_module = lib/HTML/Restrict.pm
77
88 [GatherDir]
2929 [GithubMeta]
3030
3131 [Prereqs]
32 MooX::Types::MooseLike = 0
32 MooX::Types::MooseLike = 0.23
3333 [AutoPrereqs]
3434 skip = ^MooX::Types::MooseLike
3535