Class: Raw::SqueezeFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/raw/compiler/filter/squeeze.rb

Overview

Compress HTML markup.

Instance Method Summary collapse

Instance Method Details

#apply(source) ⇒ Object

Remove new lines. Typically used in live mode before the TemplateFilter.



10
11
12
# File 'lib/raw/compiler/filter/squeeze.rb', line 10

def apply(source)
  source.gsub(/^(\s*)/m, "").gsub(/\n/, "").gsub(/\t/, " ").squeeze(" ")
end