Class: Nokogiri::XML::CDATA
- Inherits:
-
Object
- Object
- Nokogiri::XML::CDATA
- Defined in:
- lib/html2fortitude/html.rb
Overview
Instance Method Summary collapse
-
#content_without_cdata_tokens ⇒ Object
removes the start and stop markers for cdata.
- #to_fortitude(tabs, options) ⇒ Object
Instance Method Details
#content_without_cdata_tokens ⇒ Object
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
369 370 371 372 373 374 |
# File 'lib/html2fortitude/html.rb', line 369 def to_fortitude(tabs, ) content = erb_to_interpolation(self.content, ).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 |