PureHTML.TreeBuilder.Modes.Text (PureHTML v0.5.0)

View Source

HTML5 "text" insertion mode.

This mode handles the content of raw text, RCDATA, and script elements.

Per HTML5 spec:

  • Character tokens: insert the characters (a textarea drops a line feed that immediately follows its start tag)
  • End tag: pop the current node, switch to the original insertion mode (the script end tag has no script execution steps here)
  • EOF: parse error, pop the current node, switch to the original insertion mode, reprocess

See: https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-incdata