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:
5427
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
hunter [...] fire.org
Cc:
AdminCc:

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



From: M Hunter <hunter@fire.org>
To: bug-html-tidy@rt.cpan.org
Subject: HTML::Tidy usage
Date: Mon, 23 Feb 2004 21:44:36 -0700
hello Andy et al, I am trying to use HTML::Tidy within perl. I just installed Version 0.02 and I would like to pass a $scalar of HTML (from $response->content) to tidy and get warnings, errors and a new tidy converted $scalar. I have been able to feed HTML::Tidy a small string of HTML and get messages back, but when the HTML string has no messages I get a segmentation fault. Further, it's not clear to me how to use HTML::Tidy to convert a string of HTML. Here's the code I've been playing with: ======== cut below ========= # Program to use tidylib via HTML::Tidy module use HTML::Tidy; my $tidy = HTML::Tidy->new(); my $HTML = q(<html><head><title>HTML Tidy</title><body></p>HTML tidy</head></body></html> ); my $filename = '/home/hunter/D/test_tidy.txt'; if ( $tidy->parse_file( $filename, $HTML) ) { print "Parse OK\n"; if ( $tidy->messages() ) { my @messages = $tidy->messages(); foreach my $message (@messages) { print $message->text,"\n"; } } print "New HTML: $HTML\n"; } else { print "Parse NOT OK\n"; } ======= cut above ========= How do I get a copy of $HTML after tidy has been applied to it? - matt hunter
Date: Mon, 23 Feb 2004 22:53:39 -0600
From: Andy Lester <andy@petdance.com>
To: M Hunter via RT <bug-HTML-Tidy@rt.cpan.org>
CC: "AdminCc of cpan Ticket #5427": ;
Subject: Re: [cpan #5427] HTML::Tidy usage
RT-Send-Cc:
Show quoted text
> I have been able to feed HTML::Tidy a small string of HTML and get messages > back, but when the HTML string has no messages I get a segmentation fault. > Further, it's not clear to me how to use HTML::Tidy to convert a string of > HTML.
At this point, tidy doesn't actually return any tidied HTML, as the command-line tool does. It's only a problem detection system. xoa -- Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance
The segfault is fixed in 1.00.


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.