Skip Menu |

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

Report information
The Basics
Id: 69013
Status: new
Priority: 0/
Queue: HTML-Truncate

Owner: Nobody in particular
Requestors: msheppard [...]

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

Subject: Addition of support for breaking point characters other than space
Date: Wed, 22 Jun 2011 17:27:24 +1000
To: bug-html-truncate [...]
From: Matthew Sheppard <msheppard [...]>
Download (untitled) / with headers
text/plain 1.1k
Hi, I had the need to break on characters other than space, and applied this patch to HTML::Truncate. You probably wouldn't want it in this form in the mainline - I may clean it up and make it configurable at some point and send a clean version through if I get time, but you're welcome to incorporate it as it stands if you wish. Cheers, Matt Sheppard Index: /opt/enterprise-search/funnelback/lib/perl/HTML/ =================================================================== --- /opt/enterprise-search/funnelback/lib/perl/HTML/ (revision 24680) +++ /opt/enterprise-search/funnelback/lib/perl/HTML/ (working copy) @@ -421,7 +421,9 @@ my $keep = ""; if ( $self->on_space ) { - ( $keep ) = $txt =~ /\A(.{0,$chars_to_keep}\s?)(?=\s|\z)/; + # Hacked by MDS to allow dot, slash and hyphen and underscore as boundaries + ( $keep ) = $txt =~ /\A(.{0,$chars_to_keep}[\s\.\/\-_]?)(?=[\s\.\/\-_]|\z)/; + #( $keep ) = $txt =~ /\A(.{0,$chars_to_keep}\s?)(?=\s|\z)/; $keep =~ s/\s+\z//; } else

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to