///|
/// # MoonBit HTML5 Parser - API Specification
///
/// A WHATWG-compliant HTML5 parser with tokenizer, tree builder, and serializer.

// =============================================================================
// CORE PARSING API
// =============================================================================

///|
/// Parse an HTML string into a Document.
///
/// This is the main entry point for parsing HTML. The parser follows the
/// WHATWG HTML5 specification and handles malformed HTML gracefully.
///
/// Example:
/// ```
/// let doc = parse("

Hello

") /// ``` #declaration_only pub fn parse(input : String) -> Document { ... } ///| /// Parse HTML and return both the document and any parse errors encountered. /// /// Use this when you need to report or log parsing errors for diagnostics. /// /// Example: /// ``` /// let (doc, errors) = parse_with_errors("

Test

") /// // errors contains parse error information /// ``` #declaration_only pub fn parse_with_errors(input : String) -> (Document, Array[ParseError]) { ... } ///| /// Parse HTML with scripting enabled. /// /// When scripting is enabled, the content inside `