Shlomi Fish > HTML-Strip-Whitespace-0.1.6 > HTML::Strip::Whitespace

Download:
HTML-Strip-Whitespace-0.1.6.tar.gz

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

HTML::Strip::Whitespace - Perl extension for stripping whitespace out of HTML.

SYNOPSIS ^

    use HTML::Strip::Whitespace qw(html_strip_whitespace);
    
    my $html = <<"EOF";
    <html>
    <body>
    
    <p>
        Hello there!
    </p>
    
    </body>
    </html>
    EOF
    my $buffer = "";
    
    html_strip_whitespace(
        'source' => \$html,
        'out' => \$buffer
        );

DESCRIPTION ^

This module tries to strip as much whitespace from an HTML as it can without eliminating valid whitespace (like the one inside <pre>).

To use it call the function HTML::Strip::Whitespace::html_strip_whitespace, with named parameters. source is the HTML::TokeParser source for the HTML. out can be a reference to a buffer which will be filled with the stripped HTML, or alternatively a reference to a sub-routine or a file handle that will output it.

FUNCTIONS ^

html_strip_whitespace(source => $src, out => $out, strip_newlinews => $strip)

source is the HTML::TokeParser source for the HTML. out can be a reference to a buffer which will be filled with the stripped HTML, or alternatively a reference to a sub-routine or a file handle that will output it.

SEE ALSO ^

HTML Tidy with its Perl binding, which probably does a better and faster job of rendering this page.

AUTHOR ^

Shlomi Fish, <shlomif@iglu.org.il>

COPYRIGHT AND LICENSE ^

Copyright (C) 2004 by Shlomi Fish

This library is free software; you can redistribute it and/or modify it under the terms of the MIT X11 license.