Re: [SMARTY] truncate() and HTML
| From: | Maximillian Schwanekamp | Date: | Tue, 22 Mar 2005 07:20:22 +0000 |
| Subject: | Re: [SMARTY] truncate() and HTML | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12352@lists.php.net to get a copy of this message | ||
Werner wrote:
Hi! I know this does not answer your question directly, but is it really necessary to include the user's orgiginal tags/formatting in the truncated text? Normally, I strip the tags from user comments/posts/content before sending it to the templateNo, it's not totally necessary to include the tags, and yes indeed the simplest thing would be to strip the tags entirely at the application level. However, since this preview content is rather lengthy and in some cases is the only part of the content that gets read at all, it would be nice to leave in the formatting tags. Plus Smarty is so powerful, I thought maybe I had missed something that would help here. I guess outside of stripping the html, the best option is to use regex_replace in the Smarty template to look for unclosed tags. -- Maximillian Von Schwanekamp http://www.neptunewebworks.com/