Sha256: f86e6e4178d1096efcbac988e20e92a1e27e843cc11f52e745f3917df98575a1
Contents?: true
Size: 417 Bytes
Versions: 5
Compression:
Stored size: 417 Bytes
Contents
module Nitro::Compiler # Compress the inline xhtml. Does not touch the ruby code. class Squeeze # Compresses the inline xhtml. Does not touch the ruby code. def transform(text) return text.gsub(/\@out \<\< \%\^(.*?)\^/m) do |match| c = $1.gsub(/^(\s*)/m, '').squeeze(" \t").tr("\n", '').tr("\t", ' ') "@out << %{#{c}}" end end end end # * George Moschovitis <gm@navel.gr>
Version data entries
5 entries across 5 versions & 1 rubygems