Hi,

I have a variable which contains some HTML text which may contain some tags,
like <strong> or <p> and I'd like to truncate it. The problem is that
truncate doesn't preserve the HTML tags, so this can break my page, like in
this example:

$foo = "<p>blablablabla foooo</p>"

in my template:

[% FILTER truncate(10, '...') %]
   [% foo | html %]
[% END%]

=> the <p> isn't closed anymore.

Is there a function that would allow to do that ? Or an easy way to do so ?

Thanks!

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

Reply via email to