Module: Haml::Filters::Cdata

Includes:
Base
Defined in:
lib/haml/filters.rb

Overview

Surrounds the filtered text with CDATA tags.

Instance Method Summary collapse

Methods included from Base

#compile, included, #internal_compile, #render_with_options

Instance Method Details

#render(text)

See Also:



249
250
251
252
253
254
# File 'lib/haml/filters.rb', line 249

def render(text)
  text = "\n#{text}"
  text.rstrip!
  text.gsub!("\n", "\n    ")
  "<![CDATA[#{text}\n]]>"
end