Skip to main content

Module tokenizer

Module tokenizer 

Source
Expand description

The tokenizer, as section 13.2.5 of the HTML Standard describes it.

It reads the input in place rather than a character at a time, so it looks ahead instead of keeping the spec’s temporary buffer, and it hands text to the sink in runs, borrowed from the input wherever nothing in the run had to change. Given the input as it arrives, it stops wherever what’s still to come could change what it reads. Parse errors are recovered from as the spec says, and reported to the sink by name once Tokenizer::report_errors asks.

Structs§

Attrs
Doctype
Tag
Tokenizer

Enums§

TextMode
What the tree builder can ask the tokenizer to read next, after a start tag such as <title> or <script>.

Traits§

Sink
Where the tokens go.

Functions§

preprocess
The spec’s input stream preprocessing: CRLF and lone CR become LF. Most pages have no CR at all, and those are borrowed as they are.