HTML-Truncate

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        What it will probably mean in most real applications is "read more."
        The default is "…" which if the utf8 flag is true will render
        as a literal ellipsis, "chr(8230)".

        The reason the default is "…" and not "..." is this is meant
        for use in HTML environments, not plain text, and "..."
        (dot-dot-dot) is not typographically correct or equivalent to a real
        horizontal ellipsis character.

    truncate
        It returns the truncated XHTML if asked for a return value.

         my $truncated = $ht->truncate($html);

        It will truncate the string in place if no return value is expected
        (wantarray is not defined).

           $ht->truncate($html);
           print $html;

        Also can be called with inline arguments-

lib/HTML/Truncate.pm  view on Meta::CPAN

        return HTML::Entities::decode($self->{_ellipsis});
    }
    else
    {
        return $self->{_ellipsis};
    }
}

=item B<truncate>

It returns the truncated XHTML if asked for a return value.

 my $truncated = $ht->truncate($html);

It will truncate the string in place if no return value is expected
(L<wantarray> is not defined).

   $ht->truncate($html);
   print $html;

Also can be called with inline arguments-

lib/HTML/Truncate.pm.orig  view on Meta::CPAN

        return HTML::Entities::decode($self->{_ellipsis});
    }
    else
    {
        return $self->{_ellipsis};
    }
}

=item B<truncate>

It returns the truncated XHTML if asked for a return value.

 my $truncated = $ht->truncate($html);

It will truncate the string in place if no return value is expected
(L<wantarray> is not defined).

   $ht->truncate($html);
   print $html;

Also can be called with inline arguments-



( run in 0.516 second using v1.01-cache-2.11-cpan-49f99fa48dc )