Class: Nokogiri::XML::CDATA

Inherits:
Object
  • Object
show all
Defined in:
lib/html2haml/html.rb

Overview

See Also:

Instance Method Summary collapse

Instance Method Details

#content_without_cdata_tokensObject

removes the start and stop markers for cdata



232
233
234
235
236
# File 'lib/html2haml/html.rb', line 232

def content_without_cdata_tokens
  content.
    gsub(/^\s*<!\[CDATA\[\n/,"").
    gsub(/^\s*\]\]>\n/, "")
end

#to_haml(tabs, options) ⇒ Object

See Also:

  • Html2haml::HTML::Node#to_haml


225
226
227
228
229
# File 'lib/html2haml/html.rb', line 225

def to_haml(tabs, options)
  content = parse_text_with_interpolation(
    erb_to_interpolation(self.content, options), tabs + 1)
  "#{tabulate(tabs)}:cdata\n#{content}"
end