Remove HTML function

Geoff Canyon geoff at runrev.com
Sat May 18 10:14:01 EDT 2002


At 2:25 PM +1000 5/18/02, David Vaughan wrote:
>On Saturday, May 18, 2002, at 01:58 , Sivakatirswami wrote:
>
>> Does anyone have a script to removing HTML from a string/chunk/whole file?
>
>This is how I am handling a download I do daily. The general statement is pretty simple but note I also handle a special set of characters just after. Perhaps there is a general rule you could make there.
>
>-- Remove HTML tags
>  repeat for each line aLine in data
>    repeat while matchchunk(aLine,"<*>")
>      delete char offset("<",aLine) to offset(">",aLine) of aLine
>    end repeat
>    put aLine & return after outData
>  end repeat
>
>  -- Remove certain HTML characters which happen to be in the text I process
>  replace " " with empty in outData
>  replace tab with empty in outData


This will get substantially easier with the next release -- non-greedy regex should allow the find/replace to happen with one command.
-- 

regards,

Geoff Canyon <geoff at runrev.com> <http://www.runrev.com/>
Runtime Revolution Limited - The Solution for Software Development
Tel: +44 (0) 870 747 1165.  Fax: +44 (0)1639 830 707.



More information about the use-livecode mailing list