Class HTML5::HTMLParser
In: lib/html5/html5parser.rb
Parent: Object

HTML parser. Generates a tree structure from a stream of (possibly malformed) HTML

Methods

Attributes

errors  [R] 
first_start_tag  [RW] 
inner_html  [RW] 
insert_from_table  [RW] 
last_phase  [RW] 
phase  [RW] 
phases  [R] 
tokenizer  [R] 
tree  [R] 

Public Class methods

:strict - raise an exception when a parse error is encountered :tree - a treebuilder class controlling the type of tree that will be returned. Built in treebuilders can be accessed through HTML5::TreeBuilders[treeType]

Public Instance methods

HTML5 specific normalizations to the token stream

Parse a HTML document into a well-formed tree

stream - a filelike object or string containing the HTML to be parsed

The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element)

container - name of the element we‘re setting the inner_html property if set to nil, default to ‘div‘

stream - a filelike object or string containing the HTML to be parsed

The optional encoding parameter must be a string that indicates the encoding. If specified, that encoding will be used, regardless of any BOM or later declaration (such as in a meta element)

[Validate]