/
Minimal.pm
61 lines (43 loc) · 1.14 KB
/
Minimal.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
########################################################
# Copyright © 2009 Six Apart, Ltd.
package HTML::Laundry::Rules::Minimal;
use strict;
use warnings;
use base qw( HTML::Laundry::Rules );
=head1 NAME
HTML::Laundry::Rules::Minimal - a minimal set of HTML attributes
=cut
=head2 acceptable_e
Return a hashref representing a minimal list of acceptable elements:
a, b, blockquote, code, em, i, li, ol, p, pre, strong, u, and ul
=cut
sub acceptable_e {
my $self = shift;
my @acceptable = qw(
a b br blockquote code em i li ol p pre strong u ul
);
my %acceptable = map { ( $_, 1 ) } @acceptable;
return \%acceptable;
}
=head2 acceptable_a
Return a hashref representing a list of acceptable attributes to support
the minimal acceptable list ("href" only)
=cut
sub acceptable_a {
my $self = shift;
my @acceptable
= qw(href);
my %acceptable = map { ( $_, 1 ) } @acceptable;
return \%acceptable;
}
=head2 allowed_schemes
Return an arrayref representing "http" and "https" only
=cut
sub allowed_schemes {
my $self = shift;
return {
http => 1,
https => 1,
};
}
1;