Skip to main content

Crate muskitty_html5_parser

Crate muskitty_html5_parser 

Source
Expand description

MusKitty HTML Parser

Implements the WHATWG HTML parsing algorithm.

§Architecture

The parser follows the standard two-stage model (§13.2.1):

  1. Tokenization ([tokenizer]) — consumes a stream of code points and emits tokens.
  2. Tree construction (parser) — consumes tokens and builds the DOM.

§References

Modules§

error
Parse error types for the HTML parser.
parser
Tree construction stage (§13.2.6).
serialize
HTML fragment serialization (WHATWG §13.6.4 / §13.6.5).

Structs§

ParseOutput
解析结果:包含 Document 与累积的解析错误。

Constants§

MAX_INPUT_BYTES
默认输入大小上限:64 MiB(参考 Chromium 的输入保护策略)。
MAX_OPEN_ELEMENTS
默认 open elements 栈深度上限:512(参考 Chromium kMaxHTMLParserDOMDepth、 WebKit maxDOMTreeDepth = 500)。

Functions§

parse
Parse an HTML string into a Document node.
parse_fragment
Parse an HTML fragment (§13.4.2) and return the resulting DocumentFragment.
parse_with_limits
解析 HTML 字符串,自定义输入大小与栈深度限制。