Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: HTML::Tidy and mysterious HTML::Tidy::Document

by Aristotle (Chancellor)
on Jan 18, 2005 at 07:40 UTC ( [id://422920]=note: print w/replies, xml ) Need Help??


in reply to Re^2: HTML::Tidy and mysterious HTML::Tidy::Document
in thread HTML::Tidy and mysterious HTML::Tidy::Document

Someone needs to ping petdance (with a patch?). The documentation lies. Here's working code:

#!/usr/bin/perl use strict; use warnings; use HTML::Tidy; my $fname = join ' ', @ARGV; my $html = do { local $/; <> }; # slurp file(s) from commandline my $tidy = HTML::Tidy->new(); $tidy->parse( $fname, $html ); warn $_->as_string, "\n" for $tidy->messages; print $tidy->clean( $html );

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^4: HTML::Tidy and mysterious HTML::Tidy::Document
by Cody Pendant (Prior) on Jan 18, 2005 at 10:13 UTC
    Thank you. I thought I was going crazy for a while there.

    For the record, just in case it hasn't been made clear, doing

    $tidy->clean( $html );
    Leaves $html untouched.

    Next question, how does one pass command-line options to tidy via the module? Or should I quit while I'm ahead?



    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
    =~y~b-v~a-z~s; print

      Looks like you can't. I skimmed the TidyLib docs for the functions that configure its behaviour, but I don't see any calls to those in the HTML::Tidy sources. That really is a bummer. I was hoping to use the module to write a sane replacement for the annoying standalone tidy binary. It would also have been nice to be able to integrate TidyLib directly into a Perl-enabled Vim.

      Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://422920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found