######### Parsing ######### .. currentmodule:: turbohtml Turn markup into a navigable :class:`Document`. :func:`parse` handles a whole document at once; :func:`parse_fragment` parses a fragment in a context element; :class:`IncrementalParser` builds a document from chunks fed over a stream. :func:`parse_xml` switches to strict XML 1.0 well-formedness for XML rather than HTML input. Both :func:`parse` and :func:`parse_fragment` take keyword options: ``encoding`` and ``detect_encoding`` steer decoding of ``bytes`` input, ``strict`` turns the first recovered parse error into an exception, ``positions`` records each element's source line and column, ``source_locations`` additionally records the granular :class:`SourceLocation` spans (read via :attr:`Node.source_location`), ``scripting`` sets the WHATWG scripting flag so ``