Re: Read more link with HTML code
| From: | James Gadrow | Date: | Mon, 07 May 2007 14:21:57 +0000 |
| Subject: | Re: Read more link with HTML code | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43556@lists.php.net to get a copy of this message | ||
Hmmm... Perhaps you should think about separating the tags from the content? Do something like:
//Strip tags from content and add a few char hook to be used for re-insertion
//Count 200 chars (ignoring any hooks found while parsing and thereby not adding it to the char count)
//Make sure last char is a space or something appropriate
//re-insert tags over the hooks (count tags used & tags closed)
//close any inserted tags that aren't closed already in nested order
Mike van Hoof wrote:
Hello list, I got a problem with displaying content in a "read more block" which contains HTML code. The problem is as followes: I got a large piece of content, which contains HTML code (<b><u><i> etc), but after 200 characters a read more link appears. At the moment I strip al the HTML out of this piece of content, and display the full set off content on another page. But now i also want to display the bold text etc. in the first (200 chrs) content block. The only problem i have here, is that when I got a bold tag opend in the first 200 chrs, and it's closed after 400 chrs, then the rest off the page is also bold. somebody got a solution ? Thanks for reading. Mike-- Thanks, Jim