Class: Nokogiri::XML::CDATA

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

Overview

See Also:

Instance Method Summary collapse

Instance Method Details

#content_without_cdata_tokensObject

removes the start and stop markers for cdata



377
378
379
380
381
# File 'lib/html2fortitude/html.rb', line 377

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

#to_fortitude(tabs, options) ⇒ Object

See Also:

  • Html2fortitude::HTML::Node#to_fortitude


369
370
371
372
373
374
# File 'lib/html2fortitude/html.rb', line 369

def to_fortitude(tabs, options)
  content = erb_to_interpolation(self.content, options).strip
  # content = parse_text_with_interpolation(
  #   erb_to_interpolation(self.content, options), tabs + 1)
  "#{tabulate(tabs)}cdata <<-END_OF_CDATA_CONTENT\n#{content}\nEND_OF_CDATA_CONTENT"
end