PureHTML. TreeBuilder. InsertionMode behaviour
(PureHTML v0.5.0)
View Source
Behavior for HTML5 insertion mode handlers.
Each insertion mode module implements this behavior to handle tokens according to the HTML5 tree construction algorithm.
See: https://html.spec.whatwg.org/multipage/parsing.html#the-insertion-mode
Summary
Callbacks
Process a token in this insertion mode.
Types
@type result() :: {:ok, PureHTML.TreeBuilder.State.t()} | {:reprocess, PureHTML.TreeBuilder.State.t()}
Callbacks
@callback process(token(), PureHTML.TreeBuilder.State.t()) :: result()
Process a token in this insertion mode.
Returns either:
{:ok, state}- Token fully processed, continue with next token{:reprocess, state}- Token should be reprocessed in the new mode
The state may include a mode transition.