Sha256: 8a0024d848007a722ba31effc94f0507b0225defc78fe0cd2a20bc0f85b145ad
Contents?: true
Size: 315 Bytes
Versions: 2
Compression:
Stored size: 315 Bytes
Contents
module SquashWhitespace class << self def squash_html(html, options = {}) html = html.gsub(/\A\s+|\s+\Z/, '').gsub(/>\s+</, '><').gsub(/^\s+</, '<') html = html.gsub(/>\s*(.*?)\s*</, '>\1<') if options[:strip] html end end end require 'squash_whitespace/railtie' if defined?(::Rails)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
squash_whitespace-0.0.2 | lib/squash_whitespace.rb |
squash_whitespace-0.0.1 | lib/squash_whitespace.rb |