The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTML::Template::Compiled::Filter::Whitespace - whitespace filter for HTML output

VERSION

0.01

SYNOPSIS

To clean a string you can pass a scalar to the function whitespace_filter().

    my $clean_html = whitespace_filter($unclean_html);

If you are using HTML::Template::Compiled and want to clean the Template before parsing you can use the function get_whitespace_filter:

    my $htc = HTML::Template::Compiled->new(
        tagstyle  => [qw(-classic -comment +asp)],
        filter    => get_whitespace_filter(),
        scalarref => \$scalar,
    );

If you are using HTML::Template::Compiled and want to clean the output do both or only this:

    my $clean_html = whitespace_filter( $htc->output() );

If you want to disable the filter set the global variable DEBUG to something true.

  $HTML::Template::Compiled::Filter::Whitespace::DEBUG = 1;

DESCRIPTION

This package provides functions to clean out whitespaces and empty lines.

SUBROUTINES/METHODS

get_whitespace_filter

This function returns the reference to a function to clean out HTML code from whitespaces and empty lines. Can be used as filter in HTML::Template::Compiled.

whitespace_filter

This function returns a string clean from multiple whitespaces and empty lines.

DIAGNOSTICS

none

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

none

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

not known

SEE ALSO

Perl6::Export::Attrs

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2007, Steffen Winkler <steffenw@cpan.org>, Volker Voit <volker.voit@googlemail.com>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.