Class: Makiri::CDATASection

Inherits:
Node
  • Object
show all
Defined in:
lib/makiri/cdata_section.rb,
ext/makiri/makiri.c

Overview

A CDATA section. The canonical name is the WHATWG DOM interface name CDATASection; Makiri::CDATA is a Nokogiri-compatible alias (see compat_aliases.rb).

Direct Known Subclasses

HTML::CDATASection, XML::CDATASection

Class Method Summary collapse

Methods inherited from Node

#add_class, #append_class, #at, #attribute, #attribute?, #attributes, #blank?, #cdata?, #classes, #clone, #comment?, #document?, #document_fragment?, #dup, #each, #element?, #inspect, #path, #processing_instruction?, #remove_class, #root, #search, #set_attribute, #text?, #to_h, #traverse

Class Method Details

.new(document, content) ⇒ Makiri::CDATASection

Create a detached CDATA section owned by document (Nokogiri-style, document first). Delegates to Document#create_cdata - so XML only; HTML has no CDATA construction.

Parameters:

Returns:



15
16
17
# File 'lib/makiri/cdata_section.rb', line 15

def self.new(document, content)
  Makiri::Document.coerce!(document).create_cdata(content)
end