module Haml::Helpers

def preserve(input = nil, &block)

Other tags:
    Yield: - The block within which to escape newlines

Overloads:
  • perserve
  • perserve(input)

Parameters:
  • input (String) -- The string within which to escape all newlines
def preserve(input = nil, &block)
  return preserve(capture_haml(&block)) if block
  input.to_s.chomp("\n").gsub(/\n/, '
').gsub(/\r/, '')
end