Module: Nokogiri::HTML4

Defined in:
lib/nokogiri/html4.rb,
lib/nokogiri/html4/builder.rb,
lib/nokogiri/html4/document.rb,
lib/nokogiri/html4/sax/parser.rb,
lib/nokogiri/html4/entity_lookup.rb,
lib/nokogiri/html4/sax/push_parser.rb,
lib/nokogiri/html4/document_fragment.rb,
lib/nokogiri/html4/sax/parser_context.rb,
lib/nokogiri/html4/element_description.rb,
lib/nokogiri/html4/element_description_defaults.rb,
ext/nokogiri/nokogiri.c

Overview

Since v1.12.0

💡 Before v1.12.0, Nokogiri::HTML4 did not exist, and Nokogiri::HTML was the module/namespace for parsing HTML.

Defined Under Namespace

Modules: SAX Classes: Builder, Document, DocumentFragment, ElementDescription, EntityDescription, EntityLookup

Constant Summary collapse

NamedCharacters =

Instance of Nokogiri::HTML4::EntityLookup

EntityLookup.new

Class Method Summary collapse

Class Method Details

.fragment(string, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block) ⇒ Object

Parse a fragment from string in to a NodeSet.


29
30
31
# File 'lib/nokogiri/html4.rb', line 29

def fragment(string, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block)
  HTML4::DocumentFragment.parse(string, encoding, options, &block)
end

.parse(input, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block) ⇒ Object

Parse HTML. Convenience method for Nokogiri::HTML4::Document.parse


23
24
25
# File 'lib/nokogiri/html4.rb', line 23

def parse(input, url = nil, encoding = nil, options = XML::ParseOptions::DEFAULT_HTML, &block)
  Document.parse(input, url, encoding, options, &block)
end