[Nitro] html.rb

Andrew Thompson vagabond at cataclysm-software.net
Wed Apr 12 11:38:58 EDT 2006


TRANS wrote:
> Hey, what's this do exactly?
> 
>   module Glue
>   module Html
>     def self.cleanup(buf)
>       out = buf.dup
>       elements = "input|img|br|hr|link|style|render|include|inject|base|meta"
>       out.gsub! /<textarea ([^>]*)><\/textarea>/, '<textarea \1>#{}</textarea>'
>       out.gsub! /<(#{elements}) ([^>]*)><\/\1>/, '<\1 \2 />'
>       out.gsub! /<(#{elements})><\/\1>/, '<\1 />'
>       out
>     end
>   end
>   end

Manveru and I deciphered this for our compiler pipeline dealie. what it 
does is it converts empty tags like <tag></tag> to <tag/> and <tag 
foo="bar"></tag> to <tag foo="bar"/>. As far as I recall it does nothing 
to a textview, but it does nothing in an expensive fashion.

Andrew




More information about the Nitro-general mailing list