strip html

bryan mccormick brymac at
Fri Aug 2 12:49:01 EDT 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 or 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
> ___________________________________________
>         info at
>       Software - Internet Development - Consulting
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the Use-livecode mailing list