[Prototype-core] alert('test'.stripTags());

2009-04-22 Thread Yaffle
var tag = /<\/?\w+(?:\s+\w+(?:\s*=\s*(?:(?:"(?:\\.|[^"])*")| (?:'(?:\\.|[^'])*')|[^>\s]+))?)*\s*\/?>/gim; var tagName = /^<\/?(\w+)/im; String.prototype.stripHTMLTags = function(tagsToKeep){ if(tagsToKeep) tagsToKeep = tagsToKeep.invoke('toLowerCase'); return this.repla

[Prototype-core] Re: alert('test'.stripTags());

2009-04-22 Thread kangax
On Apr 22, 8:42 am, Yaffle wrote: >   var tag     = /<\/?\w+(?:\s+\w+(?:\s*=\s*(?:(?:"(?:\\.|[^"])*")| > (?:'(?:\\.|[^'])*')|[^>\s]+))?)*\s*\/?>/gim; >   var tagName = /^<\/?(\w+)/im; >   String.prototype.stripHTMLTags = function(tagsToKeep){ >     if(tagsToKeep) >           tagsToKeep = tagsToKe

[Prototype-core] Re: alert('test'.stripTags());

2009-04-22 Thread Andrew Dupont
On Apr 22, 2009, at 2:19 PM, kangax wrote: > Will fail in Safari <=2.0.2 Which we should stop supporting one of these days. Plus we could use String#gsub there instead. Cheers, Andrew --~--~-~--~~~---~--~~ You received this message because you are subscribed t