truncate() and HTML
| From: | Maximillian Schwanekamp | Date: | Tue, 22 Mar 2005 04:04:33 +0000 |
| Subject: | truncate() and HTML | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12350@lists.php.net to get a copy of this message | ||
Hello,
What is the best method for dealing with unclosed HTML tags resulting from truncate() in the Smarty template? Is there some method which I haven't noticed for closing unclosed tags from Smarty itself, or should I be using a regex from within my application? I was hoping to avoid the latter, so as to allow the designer flexibility as to the amount of content being displayed. Specifically, I have blocks of user-entered content that contains simple HTML (a,strong,img,em). Occasionally truncate() will chop the string in between <strong> and </strong> (for example), which throws my final output markup out of whack (a whole block gets <strong>'ed in this example).
Any suggestions?
--
Maximillian Von Schwanekamp
http://www.neptunewebworks.com/