lib/hamlit/compilers/strip.rb in hamlit-1.5.0 vs lib/hamlit/compilers/strip.rb in hamlit-1.5.1
- old
+ new
@@ -1,5 +1,7 @@
+# This module is created to compile [:haml, :strip],
+# which is sexp for whitespace inner removal.module Hamlit
module Hamlit
module Compilers
module Strip
def on_haml_strip(*exps)
stripped = strip_newline(exps)
@@ -8,10 +10,9 @@
private
def strip_newline(content)
indexes = newline_indexes(content)
- return content if indexes.length < 2
content = content.dup
content.delete_at(indexes.last)
content.delete_at(indexes.first)
content