Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id:
58186
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
bitcard.org [...] fremnet.net
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
1.52
Fixed in:
(no value)



Subject: Add TIDY_ACCESSIBILITY
While working with HTML::Tidy I found that it was returning messages containing accessibility information we weren't overly concerned with so I tried changing the accessibility-check only to have HTML::Tidy spew heaps of notices to stderr. Attached is a patch that catches those notices, makes them filterable, and/or returnable as TIDY_ACCESSIBILITY messages
Subject: Tidy.diff
diff -ru Old/HTML/Tidy/Message.pm New/HTML/Tidy/Message.pm --- Old/HTML/Tidy/Message.pm 2010-06-07 14:56:17.000000000 +1000 +++ New/HTML/Tidy/Message.pm 2010-06-07 14:57:00.000000000 +1000 @@ -98,6 +98,7 @@ 1 => 'Info', 2 => 'Warning', 3 => 'Error', + 4 => 'Accessibility', ); return sprintf( '%s %s %s: %s', diff -ru Old/HTML/Tidy.pm New/HTML/Tidy.pm --- Old/HTML/Tidy.pm 2010-06-07 14:41:06.000000000 +1000 +++ New/HTML/Tidy.pm 2010-06-07 14:43:33.000000000 +1000 @@ -47,11 +47,12 @@ use base 'Exporter'; -use constant TIDY_ERROR => 3; -use constant TIDY_WARNING => 2; -use constant TIDY_INFO => 1; +use constant TIDY_ACCESSIBILITY => 4; +use constant TIDY_ERROR => 3; +use constant TIDY_WARNING => 2; +use constant TIDY_INFO => 1; -our @EXPORT = qw( TIDY_ERROR TIDY_WARNING TIDY_INFO ); +our @EXPORT = qw( TIDY_ACCESSIBILITY TIDY_ERROR TIDY_WARNING TIDY_INFO ); =head1 METHODS @@ -248,9 +249,10 @@ chomp $line; my $message; - if ( $line =~ /^line (\d+) column (\d+) - (Warning|Error|Info): (.+)$/ ) { + if ( $line =~ /^line (\d+) column (\d+) - (Warning|Error|Info|Access): (.+)$/ ) { my ($line, $col, $type, $text) = ($1, $2, $3, $4); $type = + ($type eq 'Access') ? TIDY_ACCESSIBILITY : ($type eq 'Warning') ? TIDY_WARNING : ($type eq 'Info') ? TIDY_INFO : TIDY_ERROR; @@ -279,6 +281,10 @@ # Summary line we don't want } + elsif ( $line =~ /Accessibility Checks: Version/ ) { + # Summary line we don't want + + } elsif ( $line =~ m/^\s*$/ ) { # Blank line we don't want


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.