Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (31 sloc) 1.608 kB
8e33179 @snark Adding markdown README
authored
1 HTML-Laundry
2
3 HTML::Laundry is an HTML::Parser-based HTML normalizer, meant for small pieces
4 of HTML, such as user comments, Atom feed entries, and the like, rather than
5 full pages. Laundry takes these and returns clean, sanitary, UTF-8-based XHTML.
6
7 A snippet is cleaned several ways:
8
bb0944b @snark Final formatting tweak for now
authored
9 * Normalized, using HTML::Parser: attributes and elements will be lowercased,
10 empty elements such as <img /> and <br /> will be forced into the
11 empty tag syntax if needed, and unknown attributes and elements will be stripped
12 * Sanitized, using an extensible whitelist of valid attributes and elements based
13 on [WHATWG's sanitzation rules](http://wiki.whatwg.org/wiki/Sanitization_rules),
14 which are in turn based on Mark Pilgrim and Aaron Swartz's work on sanitize.py.
15 Tags and attributes which are known to be possible attack vectors are removed, and
16 URLs are rewritten to prevent cross-site scripting attacks.
17 * Tidied, using HTML::Tidy (as available): unclosed tags will be closed and the
18 output generally neatened; future version may also use HTML::Tidy to deal with
19 character encoding issues
249ca47 @snark Fixing README's list formatting
authored
20 * Optionally rebased, to turn relative URLs in attributes into absolute ones
8e33179 @snark Adding markdown README
authored
21
22 INSTALLATION
23
24 To install this module, run the following commands:
25
26 perl Makefile.PL
27 make
28 make test
29 make install
30
31 SUPPORT AND DOCUMENTATION
32
33 After installing, you can find documentation for this module with the
34 perldoc command.
35
36 perldoc HTML::Laundry
37
38 COPYRIGHT AND LICENCE
39
40 Copyright (C) 2009 Six Apart, Ltd.
41
42 This program is free software; you can redistribute it and/or modify it
43 under the same terms as Perl itself.
Something went wrong with that request. Please try again.