Module

rendering.parsers.factory

HTML parser factory for Bengal.

Returns NativeHTMLParser, optimized for build-time validation and health checks. Replaced BeautifulSoup4 for performance (~5-10x faster for text extraction).

Classes

ParserBackend
HTML parser backend identifiers.
0

HTML parser backend identifiers.

ParserFactory
Factory for HTML parsers used in Bengal. Currently returns NativeHTMLParser, which is optimized fo…
2

Factory for HTML parsers used in Bengal.

Currently returns NativeHTMLParser, which is optimized for build-time validation and health checks. Replaced BeautifulSoup4 for performance (~5-10x faster for text extraction).

Methods 2

get_html_parser staticmethod
Get HTML parser for build-time validation and health checks.
1 Callable[..., Any]
def get_html_parser(backend: str | None = None) -> Callable[..., Any]

Get HTML parser for build-time validation and health checks.

Parameters 1
backend str | None

Parser backend (currently only 'native' supported)

Returns

Callable[..., Any]

Parser callable that returns NativeHTMLParser instance

get_parser_features staticmethod
Get features/capabilities for a backend.
1 dict[str, Any]
def get_parser_features(backend: str) -> dict[str, Any]

Get features/capabilities for a backend.

Parameters 1
backend str

Parser backend identifier

Returns

dict[str, Any]

Dictionary of parser features