So far I've found:
- HTML::CGIChecker (I've used this some)
- HTML::Scrubber
- HTML::Sanitizer
- HTML::TagFilter
- HTML::StripScripts
and I'm sure there's more where those came from.
What's wrong with all of these is the OO interface. I just can't get real excited about OO interfaces for filters.
So instead of
use strict;
use HTML::OOMarkupRemover;
my $hsmr = HTML::SomeMarkupRemover->new(\%html_rules);
$hsmr->passes_rules($some_html)
or die "Ack! I can't cope!";
my $clean_html = $htmr->apply_rules($some_html);
I would so much rather have a procedural interface
use strict;
use HTML::ProceduralMarkupRemover;
html_passes_rules($some_html, \%html_rules)
or die "Ack! I can't cope!";
my $clean_html = apply_html_rules($come_html, \%html_rules);
So: anyone know of a module like that?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.