Skip to content

Commit

Permalink
docs: small edits to the HTML5 docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Jul 9, 2021
1 parent 3399e16 commit 2bb0084
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/nokogiri/html5.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
#
# === Error reporting
#
# Nokogumbo contains an experimental parse error reporting facility. By default, no parse errors
# are reported but this can be configured by passing the +:max_errors+ option to {HTML5.parse} or
# {HTML5.fragment}.
# Nokogiri contains an experimental HTML5 parse error reporting facility. By default, no parse
# errors are reported but this can be configured by passing the +:max_errors+ option to
# {HTML5.parse} or {HTML5.fragment}.
#
# For example, this script:
#
Expand Down Expand Up @@ -88,7 +88,7 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
# parsing HTML. The parse errors in the "tree construction" stage do not have standardized error
# codes (yet).
#
# As a convenience to Nokogumbo users, the defined error codes are available via
# As a convenience to Nokogiri users, the defined error codes are available via
# {Nokogiri::XML::SyntaxError#str1} method.
#
# doc = Nokogiri::HTML5.parse('<span/>Hi there!</span foo=bar />', max_errors: 10)
Expand All @@ -104,7 +104,7 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
# stage and doesn't have a standardized error code.
#
# For the purposes of semantic versioning, the error messages, error locations, and error codes
# are not part of Nokogumbo's public API. That is, these are subject to change without Nokogumbo's
# are not part of Nokogiri's public API. That is, these are subject to change without Nokogiri's
# major version number changing. These may be stabilized in the future.
#
# === Maximum tree depth
Expand All @@ -113,8 +113,8 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
# +:max_tree_depth+ option. If the depth of the tree would exceed this limit, then an
# {::ArgumentError} is thrown.
#
# This limit (which defaults to <tt>Nokogumbo::DEFAULT_MAX_TREE_DEPTH = 400</tt>) can be removed
# by giving the option <tt>max_tree_depth: -1</tt>.
# This limit (which defaults to <tt>Nokogiri::Gumbo::DEFAULT_MAX_TREE_DEPTH = 400</tt>) can be
# removed by giving the option <tt>max_tree_depth: -1</tt>.
#
# html = '<!DOCTYPE html>' + '<div>' * 1000
# doc = Nokogiri.HTML5(html)
Expand All @@ -126,8 +126,8 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
# The maximum number of attributes per DOM element is configurable by the +:max_attributes+
# option. If a given element would exceed this limit, then an {::ArgumentError} is thrown.
#
# This limit (which defaults to <tt>Nokogumbo::DEFAULT_MAX_ATTRIBUTES = 400</tt>) can be removed
# by giving the option <tt>max_attributes: -1</tt>.
# This limit (which defaults to <tt>Nokogiri::Gumbo::DEFAULT_MAX_ATTRIBUTES = 400</tt>) can be
# removed by giving the option <tt>max_attributes: -1</tt>.
#
# html = '<!DOCTYPE html><div ' + (1..1000).map { |x| "attr-#{x}" }.join(' ') + '>'
# # "<!DOCTYPE html><div attr-1 attr-2 attr-3 ... attr-1000>"
Expand Down Expand Up @@ -182,7 +182,7 @@ def self.HTML5(input, url = nil, encoding = nil, **options, &block)
#
# == Encodings
#
# Nokogumbo always parses HTML using {https://en.wikipedia.org/wiki/UTF-8 UTF-8}; however, the
# Nokogiri always parses HTML5 using {https://en.wikipedia.org/wiki/UTF-8 UTF-8}; however, the
# encoding of the input can be explicitly selected via the optional +encoding+ parameter. This is
# most useful when the input comes not from a string but from an IO object.
#
Expand Down

0 comments on commit 2bb0084

Please sign in to comment.