in reply to Pondering Portals
From the pod:
#!/usr/bin/perl -w use HTML::Scrubber; use strict; my $html = q[ <style type="text/css"> BAD { background: #666; color: #666;} </style> <script language="javascript"> alert("Hello, I am EVIL!"); </script> <HR> a => <a href=1>link </a> br => <br> b => <B> bold </B> u => <U> UNDERLINE </U> ]; my $scrubber = HTML::Scrubber->new( allow => [ qw[ p b i u hr br ] ] ) +; print $scrubber->scrub($html); $scrubber->deny( qw[ p b i u hr br ] ); print $scrubber->scrub($html); __END__ Output: <hr> a => link br => <br> b => <b> bold </b> u => <u> UNDERLINE </u> a => link br => b => bold u => UNDERLINE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Pondering Portals
by skx (Parson) on Apr 30, 2005 at 15:25 UTC | |
by bmann (Priest) on May 01, 2005 at 06:09 UTC | |
by skx (Parson) on May 01, 2005 at 16:24 UTC |