Skip Menu |

This queue is for tickets about the HTML-Truncate CPAN distribution.

Report information
The Basics
Id: 47832
Status: resolved
Worked: 15 min
Priority: 0/
Queue: HTML-Truncate

People
Owner: ashley [...] cpan.org
Requestors: bobtfish [...] bobtfish.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Example code for TT filter doesn't work correctly
Date: Mon, 13 Jul 2009 12:59:28 +0100
To: bug-HTML-Truncate [...] rt.cpan.org
From: Tomas Doran <bobtfish [...] bobtfish.net>
Patch for the docs attached. Cheers t0m
diff -ur HTML-Truncate-0.19/lib/HTML/Truncate.pm HTML-Truncate-0.19.t0m/lib/HTML/Truncate.pm --- HTML-Truncate-0.19/lib/HTML/Truncate.pm 2009-05-13 06:04:07.000000000 +0100 +++ HTML-Truncate-0.19.t0m/lib/HTML/Truncate.pm 2009-07-13 12:58:27.000000000 +0100 @@ -648,10 +648,10 @@ my ( $context, $len, $ellipsis ) = @_; $len = 32 unless $len; $ellipsis = chr(8230) unless defined $ellipsis; - my $html = shift || return ''; my $ht = HTML::Truncate->new(); $ht->add_skip_tags(qw( img )); return sub { + my $html = shift || return ''; return $ht->truncate( $html, $len, $ellipsis ); } }
On the way up: File successfully copied to '/home/ftp/incoming/HTML-Truncate-0.20.tar.gz' Thank you VERY much for the patch. Your in the changes, tell me if you want to be attributed differently.