strip html

bryan mccormick brymac at i-2000.com
Fri Aug 2 12:49:01 CDT 2002


my guess is that there is some paren mis-match in the html that causes 
the script to go into some form of infinite loop.

um, try this and see if it works for you. a little clunky but it works 
for me.

on stripTags theContainer
  put 1 into firstTag
  repeat until firstTag = 0 or lastTag = 0
    put  offset("<", theContainer) into firstTag
    put offset(">", theContainer) into lastTag
   
    if lastTag  < firstTag then
      delete char lastTag of theContainer
      next repeat
    end if
    delete char firstTag to lastTag of theContainer
  end repeat
  return theContainer
end stripTags


sims wrote:

> If I use the following script on a simple web page to strip
> html it works with no problem.
>
> If I try this with cnn.com or nytimes.com it hangs.
>
> Can anyone help me out with fixing it or
> suggesting a better way to strip html"?
>
> (I do not want to use the "set the  htmlTEXT" trick)
>
> atb
>
> sims
>
>
>
> on mouseUp
>   put fld "cnn" into data
>    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
> put outData into fld "cnn"
> end mouseUp
> ___________________________________________
>
>    http://EZPZapps.com         info at EZPZapps.com
>       Software - Internet Development - Consulting
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>





More information about the use-livecode mailing list