remove html tags from text

Richard Gaskin ambassador at
Sun Sep 10 13:55:18 EDT 2006

Mark Smith wrote:
> On 10 Sep 2006, at 16:26, Richard Gaskin wrote:
>> So until someone can demonstrate otherwise, I'm sticking with using  
>> fields to strip tags from text.....
> Though doesn't this approach fail with legitimate "<" characters in  
> <code>  (or other) tags?
> Of course, that may not be important in your usage.

It's very important for most of us, since we're looking for the most 
robust solution.

I just tried it and found that this:

put 2<3

...produces an incomplete rendering like this:

   put 2

...but this:

put 2< 3
</pre> rendered as expected like this:

put 2< 3

I would imagine similar results if we special-case the regex solution to 
also handle non-white space after a "<".

If both methods are equally robust then the one to use would be the 
fastest.  But if one of more fault-tolerant than the other, than if the 
speed of both is at least acceptable than I'd go with the more robust one.

  Richard Gaskin
  Managing Editor, revJournal
  Rev tips, tutorials and more:

More information about the Use-livecode mailing list