parserino.html.parser

The HTML parser: tokenizer + tree builder, for documents (also chunk by chunk) and fragments.

Types 1

structParser

A parser. It must not be moved after begin (the tokenizer points to the tree builder): keep it in memory that doesn't move (heap, or a local variable used in place).

Fields
Tokenizer tokenizer
Methods
void begin(DomDocument * doc) @nogc nothrow pure @safeStart parsing `doc` (an empty document)
bool feed(scope const(char)[] chunk) @nogc nothrow pure @safeParse a chunk of input. It returns false if out of memory.
bool finish() @nogc nothrow pure @safeEnd of input

Functions 4

fnbool parseDocument(DomDocument * doc, scope const(char)[] html) @nogc nothrow pure @safeParse a whole document into `doc` (an empty document)
fnDomElement * parseFragment(DomDocument * doc, DomElement * context, scope const(char)[] html) @nogc nothrow pure @safeParse a fragment in the context of `context` (an element of `doc`). It returns a detached `<html>` element whose children are the result, or null if out of memory.
fnParser * newParser() @nogc nothrow pure @safe @trustedA parser on the heap (it must not move), initialized
fnvoid freeParser(Parser * p) @nogc nothrow pure @safe @trustedFree a parser made by `newParser`