remove html tags from text

J. Landman Gay jacque at hyperactivesw.com
Sat Sep 9 01:07:06 EDT 2006


Cubist at aol.com wrote:
> In a message dated 9/8/06 11:40:31 AM, Mark Wieder <mwieder at ahsoftware.net> 
> writes:
>> Friday, September 8, 2006, 6:10:53 AM, you wrote:
>>> barely tested, but maybe a starting point:
>>> function striptags tHtml
>>>    replace cr with empty in tHtml -- in case of multi-line tags
>>>    replace "<" with cr & "<" in tHtml
>>>    replace ">" with ">" & cr in tHtml
>>>    filter tHtml without "*<*"
>>>    filter tHtml without "*>*"
>>>    return tHtml
>>> end striptags
>> Clever... but it'll fail on
>>
>> if xyz > 4096 then
>    No, it won't; not if you're working with an honest-to-God HTML document, 
> at least. Greater-than and less-than signs are *only* found *in the HTML 
> source*; if you want either of those symbols to show up when someone views your page 
> in a browser window, both of them will be HTML entities that start with an 
> ampersand and end with a semicolon.

Except when placed within a set of <CODE> tags. ;)

The tutorials at my web site are full of this sort of thing.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list