use strict;
+use SL::HTML::Restrict;
+
use parent qw(Exporter);
use Exporter qw(import);
-our @EXPORT = qw(html_tag input_tag man_days_tag name_to_id select_tag stringify_attributes);
+our @EXPORT = qw(html_tag input_tag man_days_tag name_to_id select_tag stringify_attributes restricted_html);
use Carp;
return %{ $attributes };
}
+my $html_restricter;
+
+sub restricted_html {
+ my ($self, $value) = @_;
+
+ $html_restricter ||= SL::HTML::Restrict->create;
+ return $html_restricter->process($value);
+}
+
1;
__END__
HTML tag attributes. Keys and values are HTML escaped even though keys
must not contain non-ASCII characters for browsers to accept them.
+=item C<restricted_html $html>
+
+Returns HTML stripped of unknown tags. See L<SL::HTML::Restrict>.
+
=back
=head2 HIGH-LEVEL FUNCTIONS