Anyone got one of these?

Ken Ray kray at sonsothunder.com
Fri Jan 26 14:31:22 EST 2007


On Fri, 26 Jan 2007 12:56:36 -0600, Chipp Walters wrote:

> function stripAllTagsBut pHtml,pTagsList
>  --> pTagsList IS A LIST OF TAGS NOT TO EXCLUDE FROM PARSING
>  --> EX. LINE 1 OF pTagsList CAN BE "img" AND LINE 2 CAN BE "b", etc..
> 
> 
> It's used to strip all tags from HTML but those in the pTagsList parameter.
> 
> IOW, it can be used to grab the HTML of a page, and strip everything but the
> img tags.
> 
> I'm starting to write it, but thought I'd ask-- just in case.

Closest thing I have is:

function stsStripHTML what
  put replaceText(what,"(?si)<script.*?/script>","") into what
  put replaceText(what,"(?si)<style.*?/style>","") into what
  put replaceText(what,"<.*?>","") into what
  put replaceText(what,tab,"") into what
  put replaceText(what,CR & "{3,}","") into what
  return what
end stsStripHTML

But this strips all tags...

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list