Skip to content
This repository has been archived by the owner on Sep 1, 2019. It is now read-only.
/ p6-html-restrict Public archive

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

License

Notifications You must be signed in to change notification settings

stmuk/p6-html-restrict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 [email protected] 20150806

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

  • Other 100.0%