Skip Menu |

This queue is for tickets about the HTML-Scrubber CPAN distribution.

Report information
The Basics
Id: 120384
Status: open
Priority: 0/
Queue: HTML-Scrubber

People
Owner: Nobody in particular
Requestors: bkb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.15
Fixed in: (no value)



Subject: Adds false </br> tags
This example code: use warnings; use strict; use utf8; my $snippet = q{ <P STYLE="font-size: 300%"><BLINK>"You may get to touch her<BR> If your gloves are sterilized<BR></BR> Rinse your mouth with Listerine</BR> Blow disinfectant in her eyes"</BLINK><BR> -- X-Ray Spex, <I>Germ-Free Adolescents<I> <SCRIPT>alert('!!');</SCRIPT> }; use HTML::Scrubber; my $scrub = HTML::Scrubber->new (allow => [ qw[ p b i u hr br ] ] ); print $scrub->scrub ($snippet); adds false </br> tags to the HTML output: <p>"You may get to touch her<br> If your gloves are sterilized<br></br> Rinse your mouth with Listerine</br> Blow disinfectant in her eyes"<br> -- X-Ray Spex, <i>Germ-Free Adolescents<i> There is no </br> tag in HTML. Incidentally HTML::Restrict has an almost identical bug: https://github.com/oalders/html-restrict/issues/24
Subject: Doesn't remove ending </br> tags
On Sat Feb 25 20:16:43 2017, BKB wrote: Show quoted text
> This example code: > > use warnings; > use strict; > use utf8; > my $snippet = q{ > <P STYLE="font-size: 300%"><BLINK>"You may get to touch her<BR> > If your gloves are sterilized<BR></BR> > Rinse your mouth with Listerine</BR> > Blow disinfectant in her eyes"</BLINK><BR> > -- X-Ray Spex, <I>Germ-Free Adolescents<I> > <SCRIPT>alert('!!');</SCRIPT> > }; > use HTML::Scrubber; > my $scrub = HTML::Scrubber->new (allow => [ qw[ p b i u hr br ] ] ); > print $scrub->scrub ($snippet); > > adds false </br> tags to the HTML output: > > > <p>"You may get to touch her<br> > If your gloves are sterilized<br></br> > Rinse your mouth with Listerine</br> > Blow disinfectant in her eyes"<br> > -- X-Ray Spex, <i>Germ-Free Adolescents<i> > > There is no </br> tag in HTML. > > Incidentally HTML::Restrict has an almost identical bug: > > https://github.com/oalders/html-restrict/issues/24
Sorry, my error entirely, I should have written "does not remove false ending br tags".
On Sun Feb 26 02:16:43 2017, BKB wrote: Show quoted text
> This example code: > > use warnings; > use strict; > use utf8; > my $snippet = q{ > <P STYLE="font-size: 300%"><BLINK>"You may get to touch her<BR> > If your gloves are sterilized<BR></BR> > Rinse your mouth with Listerine</BR> > Blow disinfectant in her eyes"</BLINK><BR> > -- X-Ray Spex, <I>Germ-Free Adolescents<I> > <SCRIPT>alert('!!');</SCRIPT> > }; > use HTML::Scrubber; > my $scrub = HTML::Scrubber->new (allow => [ qw[ p b i u hr br ] ] ); > print $scrub->scrub ($snippet); > > adds false </br> tags to the HTML output: > > > <p>"You may get to touch her<br> > If your gloves are sterilized<br></br> > Rinse your mouth with Listerine</br> > Blow disinfectant in her eyes"<br> > -- X-Ray Spex, <i>Germ-Free Adolescents<i> > > There is no </br> tag in HTML. > > Incidentally HTML::Restrict has an almost identical bug: > > https://github.com/oalders/html-restrict/issues/24
I've submitted a patch which corrects this issue: https://github.com/nigelm/html-scrubber/pull/16. Let me know if anything needs to be changed in the patch and I'll update and resubmit. Cheers, Paul