diff --git a/MANIFEST b/MANIFEST index 7e8e775..5889b35 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,6 +1,7 @@ Build.PL Changes ignore.txt +lib/Data/FormValidator/Filters/HTML/Acid.pm lib/HTML/Acid.pm lib/HTML/Acid/Buffer.pm Makefile.PL @@ -10,6 +11,9 @@ README t/00.load.t t/01.progression.t t/02.buffer.t +t/03_variant.t +t/04.dfv.t +t/05.dfv-variant.t t/changes.t t/in/00-identical t/in/01-unclosed-image @@ -21,6 +25,7 @@ t/in/05-1-bad-image t/in/05-2-bad-image t/in/05-3-bad-image t/in/05-4-bad-image +t/in/06-img-endtag t/in/10-missing-p t/in/11-extra-end-tag t/in/12-no-doc-end @@ -41,6 +46,9 @@ t/in/34-external-href t/in/35-almost-empty-anchor t/in/36-missing-anchor-title t/in/37-empty-header +t/in/38-dodgy-alt +t/in/40-variant +t/lib/variant.pm t/manifest.t t/out/00-identical t/out/01-unclosed-image @@ -52,6 +60,7 @@ t/out/05-1-bad-image t/out/05-2-bad-image t/out/05-3-bad-image t/out/05-4-bad-image +t/out/06-img-endtag t/out/10-header-id t/out/10-missing-p t/out/11-extra-end-tag @@ -73,8 +82,44 @@ t/out/34-external-href t/out/35-almost-empty-anchor t/out/36-missing-anchor-title t/out/37-empty-header +t/out/38-dodgy-alt +t/out/40-variant t/perlcritic.t t/pod-coverage.t t/pod.t t/podspell.t t/prereq.t +t/variant/00-identical +t/variant/01-unclosed-image +t/variant/02-text-inside-image +t/variant/03-end-attributes +t/variant/04-spans +t/variant/05-0-bad-image +t/variant/05-1-bad-image +t/variant/05-2-bad-image +t/variant/05-3-bad-image +t/variant/05-4-bad-image +t/variant/06-img-endtag +t/variant/10-header-id +t/variant/10-missing-p +t/variant/11-extra-end-tag +t/variant/12-no-doc-end +t/variant/13-misplaced-start +t/variant/14-strong-at-start +t/variant/20-br-drop +t/variant/21-br-break +t/variant/22-br-space +t/variant/23-br-strong +t/variant/24-br-header +t/variant/25-br-text +t/variant/26-br-enddoc +t/variant/30-emptypara +t/variant/31-header-no-id +t/variant/32-external-img +t/variant/33-empty-anchor +t/variant/34-external-href +t/variant/35-almost-empty-anchor +t/variant/36-missing-anchor-title +t/variant/37-empty-header +t/variant/38-dodgy-alt +t/variant/40-variant diff --git a/lib/Data/FormValidator/Filters/HTML/Acid.pm b/lib/Data/FormValidator/Filters/HTML/Acid.pm index 262dd9f..3224496 100644 --- a/lib/Data/FormValidator/Filters/HTML/Acid.pm +++ b/lib/Data/FormValidator/Filters/HTML/Acid.pm @@ -1,11 +1,12 @@ package Data::FormValidator::Filters::HTML::Acid; use base qw(Exporter); - -@EXPORT = qw(filter_html); - use warnings; use strict; use Carp; +use vars qw(@EXPORT); + +@EXPORT = qw(filter_html); + use HTML::Acid; use version; our $VERSION = qv('0.0.1'); @@ -26,7 +27,7 @@ __END__ =head1 NAME -Data::FormValidator::Filters::HTML::Acid - HTML::Acid in DFV framework +Data::FormValidator::Filters::HTML::Acid - HTML::Acid in a popular data cleansing framework =head1 VERSION diff --git a/lib/HTML/Acid.pm b/lib/HTML/Acid.pm index 151cd62..270b8c2 100644 --- a/lib/HTML/Acid.pm +++ b/lib/HTML/Acid.pm @@ -401,8 +401,9 @@ URL. They may also have a C attribute. =item * Images must have C<src>, C<title>, C<alt>, C<height> and C<width> attributes. The C<src> attribute must match the same regular expression as C<href>. If any of these tags are missing the image is replaced by -the contents of the alt attribute, so long as it consists only of alphanumeric -characters, spaces, full stops and commas. Otherwise the image is removed. +the contents of the C<alt> attribute, so long as it consists only of +alphanumeric characters, spaces, full stops and commas. Otherwise the image +is removed. =item * All other tags must have no attributes and may only contain text. @@ -467,18 +468,18 @@ This module works by subclassing L<HTML::Parser>. None reported. -=head1 TODO +=head1 TO DO =over -=item * More relaxed treatment of the alt tag would be good. However it is +=item * More relaxed treatment of the C<alt> tag would be good. However it is easier to go from restrictive behaviour to more relaxed so it will stay like it is for now. =item * Sooner or later a little more flexibility in handling attributes will be required. -=item * I think this module could do with an XS backend for a speed up. +=item * I think this module could do with an XS back-end for a speed up. =back diff --git a/t/podspell.t b/t/podspell.t index fd9146d..73633ae 100644 --- a/t/podspell.t +++ b/t/podspell.t @@ -22,10 +22,12 @@ Test::Spelling::add_stopwords(qw( AnnoCPAN detaint github HTML + URL inline javascript RT XHTML + XS XSS)); Test::Spelling::all_pod_files_spelling_ok();