Print Page | Close Window

Trimmed display issue

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Rich Text Editor (RTE)
Forum Description: Support forum for the Web Wiz Rich Text Editor (RTE).
URL: https://forums.webwiz.net/forum_posts.asp?TID=17340
Printed Date: 29 March 2026 at 9:20am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Trimmed display issue
Posted By: rocketdawg
Subject: Trimmed display issue
Date Posted: 24 November 2005 at 5:20pm
When I display only the first 200 characters of the story as a brief teaser, something funny happens. If on chance, the 200th character is within an html formating tag, the formating continues on through the loop and displays into the next brief description, and so on.
 
Here is the code to display the brief story description:
 
 
<p class="text"><% = (left(rsStory("STORY_DESCRIPTION"), 200))  %>  ...</p>
 
I would think that removing the html formating tags prior to browser display would do it, but does anyone know how to do that?
 
ie: 
 
txt = rsStory("STORY_DESCRIPTION")
 
txt2 = replace(txt,< htmlformatcode >, "")
 
and then
 
<p class="text"><% = (left(txt2), 200))  %>  ...</p>
 
Sound good in my head, but ...
 
anybody have any good suggestions? How would I do this?



Replies:
Posted By: rocketdawg
Date Posted: 26 November 2005 at 4:07pm

I found the answer in case anybody ever searches for this problem again.

 
Function RemoveHTML( strText )
	Dim RegEx
	Set RegEx = New RegExp
	RegEx.Pattern = "<[^>]*>"
	RegEx.Global = True
	strText = Replace(LCase(strText), "<br>", chr(10))
	RemoveHTML = RegEx.Replace(strText, "")
End Function



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net