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


HTML-Template-Compiled-Filter-Whitespace documentation  | view source Contained in the HTML-Template-Compiled-Filter-Whitespace distribution.

Index


NAME

Top

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

VERSION

Top

0.08

SYNOPSIS

Top

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

    use HTML::Template::Compiled::Filter::Whitespace qw(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:

    use HTML::Template::Compiled::Filter::Whitespace qw(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:

    use HTML::Template::Compiled::Filter::Whitespace qw(whitespace_filter);

    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;

EXAMPLE

Top

Inside of this Distribution is a directory named example. Run this *.pl files.

DESCRIPTION

Top

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

HTML tags pre, code and textarea will be unchanged.

SUBROUTINES/METHODS

Top

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

Top

none

CONFIGURATION AND ENVIRONMENT

Top

none

DEPENDENCIES

Top

Perl6::Export::Attrs

INCOMPATIBILITIES

Top

not known

BUGS AND LIMITATIONS

Top

not known

SEE ALSO

Top

HTML::Template::Compiled

AUTHOR

Top

Steffen Winkler

LICENSE AND COPYRIGHT

Top


HTML-Template-Compiled-Filter-Whitespace documentation  | view source Contained in the HTML-Template-Compiled-Filter-Whitespace distribution.