Octavian Râşniţă wrote:
> This TT plugin would be exactly what I need, but unfortunately it doesn't 
> print correctly the UTF-8 chars. I have read the POD docs of HTML::Strip 
> also, but I couldn't find anything about setting the charset or something 
> like that.
> 
> So I think that making an HTML::Strip -based custom script will have the 
> same results.
> 
> I need that kind of filter because I need to get some longer HTML content, 
> and truncate it and then print the text, but if I just truncate the HTML, it 
> might give bad results because I could start a table or list or link without 
> ending them...

You might try checking out this TT list thread around 4/10/2009:
"Truncate that preserves HTML tags ?"

We talked about various things you could use there.

For example this could be useful:
http://search.cpan.org/~ashley/HTML-Truncate-0.20/lib/HTML/Truncate.pm

Or you can check out this example from HTML::Parser:
http://cpansearch.perl.org/src/GAAS/HTML-Parser-3.64/eg/htext

There is a lot of information in that thread above, so you might try reading 
through it.

-- Josh

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to