Perl6 HTML::Restrict - attempt to sanitise HTML via good and bad tags
Other
Switch branches/tags
Nothing to show
Latest commit 27358c1 Apr 29, 2017 @stmuk committed on GitHub Merge pull request #1 from samcv/SPDX-license
Use SPDX identifier in license field of META6.json
Permalink
Failed to load latest commit information.
lib/HTML generate README.md from pod Jan 23, 2016
t fix test Jan 4, 2016
.travis.yml update travis Nov 28, 2015
LICENSE first commit Aug 6, 2015
META6.json Use SPDX identifier in license field of META6.json Apr 28, 2017
README.md generate README.md from pod Jan 23, 2016

README.md

NAME

HTML::Restrict - attempt to sanitise HTML via good and bad tags

SYNOPSIS

   use HTML::Restrict;

   my $hr = HTML::Restrict.new(
                      :good-tags(<a b br em hr i img p strong tt u>),
                      :bad-attrib-vals(any(rx/onmouseover/, rx/javascript/)),
                      :recurse-depth(100), 
                      );

   my XML::Document $doc = $hr.process(:$html);

   my $got = $doc.gist;

DESCRIPTION

CAUTION THIS MAY NOT BE SECURE FOR PRODUCTION USE YET.

Delete specified HTML tags, attributes and attribute values from HTML in an attempt to sanitise HTML for safer use.

Heavily influenced by existing similar perl5 modules such as the one of the same name.

Defaults for @.good-tags, $.recurse-depth and @.bad-attrib-vals are as above so may be omitted.

Pull requests welcome.

AUTHOR

Steve Mynott steve.mynott@gmail.com 20150806