We have to test something.
'; my $readmore = '... [readmore]'; my $html_truncate = HTML::Truncate->new(); $html_truncate->chars(20); $html_truncate->ellipsis($readmore); print $html_truncate->truncate($html); # or use Encode; my $ht = HTML::Truncate->new( utf8_mode => 1, chars => 1_000, ); print Encode::encode_utf8( $ht->truncate($html) ); =head1 XHTML This module is designed to work with XHTML-style nested tags. More below. =head1 WHITESPACE AND ENTITIES Repeated natural whitespace (i.e., "\s+" and not " ") in HTML -- with rare exception (pre tags or user defined styles) -- is not meaningful. Therefore it is normalized when truncating. Entities are also normalized. The following is only counted 14 chars long. \n\nthis is ‘text’\n\n
^^^^^^^12345----678--9------01234------^^^^^^^^ =head1 METHODS =over 4 =item B