HTML::Trim - HTML trimmer
use HTML::Trim; my $trimmed = HTML::Trim::vtrim('foo bar <a href="/">baz</a> fumino', 10, '…'); #=> 'foo bar <a href="hoge">b</a>...'
HTML::Trim is for trimming text by the number of character length or visual width (consider full-width characters).
HTML::Trim::trim($html, $length, $terminal)
Trim $html by character $length. When result is clipped, add $terminal to result HTML.
$html
$length
$terminal
HTML::Trim::vtrim($html, $width, $terminal)
Trim $html by character $width (half-width = 1). When result is clipped, add $terminal to result HTML.
$width
cho45 <cho45@lowreal.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::Trim, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Trim
CPAN shell
perl -MCPAN -e shell install HTML::Trim
For more information on module installation, please visit the detailed CPAN module installation guide.