class Haml::Filters::Preserve

Public Instance Methods

compile(node) click to toggle source
# File lib/haml/filters/preserve.rb, line 5
def compile(node)
  text = node.value[:text].rstrip + "\n"
  text = text.gsub("\n", '
')
  compile_text(text)
end

Private Instance Methods

compile_text(text) click to toggle source
# File lib/haml/filters/preserve.rb, line 13
def compile_text(text)
  if ::Haml::Util.contains_interpolation?(text)
    [:dynamic, ::Haml::Util.unescape_interpolation(text)]
  else
    [:static, text]
  end
end