Bumps version to 2.1.3
Olaf Alders
11 years ago
0 | 0 |
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).
|
1 | 6 |
|
2 | 7 |
2.1.2 2013-03-20
|
3 | 8 |
- Fixes broken Pod in example script.
|
1 | 1 |
HTML::Restrict - Strip unwanted HTML tags and attributes
|
2 | 2 |
|
3 | 3 |
VERSION
|
4 | |
version 2.1.2
|
|
4 |
version 2.1.3
|
5 | 5 |
|
6 | 6 |
SYNOPSIS
|
7 | 7 |
use HTML::Restrict;
|
|
212 | 212 |
$html = $hr->process( $html );
|
213 | 213 |
# $html is now: "<!-- comments! -->foo"
|
214 | 214 |
|
|
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 |
|
215 | 232 |
* strip_enclosed_content => [0|1]
|
216 | 233 |
|
217 | 234 |
The default behaviour up to 1.0.4 was to preserve the content
|
2 | 2 |
license = Perl_5
|
3 | 3 |
copyright_holder = Olaf Alders
|
4 | 4 |
copyright_year = 2013
|
5 | |
version = 2.1.2
|
|
5 |
version = 2.1.3
|
6 | 6 |
main_module = lib/HTML/Restrict.pm
|
7 | 7 |
|
8 | 8 |
[GatherDir]
|
|
29 | 29 |
[GithubMeta]
|
30 | 30 |
|
31 | 31 |
[Prereqs]
|
32 | |
MooX::Types::MooseLike = 0
|
|
32 |
MooX::Types::MooseLike = 0.23
|
33 | 33 |
[AutoPrereqs]
|
34 | 34 |
skip = ^MooX::Types::MooseLike
|
35 | 35 |
|