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


HTML-Strip-Whitespace documentation  | view source Contained in the HTML-Strip-Whitespace distribution.

Index


NAME

Top

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

SYNOPSIS

Top

    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

Top

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

Top

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

Top

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

AUTHOR

Top

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

COPYRIGHT AND LICENSE

Top


HTML-Strip-Whitespace documentation  | view source Contained in the HTML-Strip-Whitespace distribution.