Class: Raw::SqueezeFilter
- Inherits:
-
Object
- Object
- Raw::SqueezeFilter
- Defined in:
- lib/raw/compiler/filter/squeeze.rb
Overview
Compress HTML markup.
Instance Method Summary collapse
-
#apply(source) ⇒ Object
Remove new lines.
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 |