Skip to main content

Interface: Parse5Options

Options for parse5, the default parser for HTML.

Hierarchy

Properties

onParseError

Optional onParseError: null | ParserErrorHandler

Callback for parse errors.

Default

null

Inherited from

Parse5ParserOptions.onParseError

Defined in

node_modules/parse5/dist/cjs/parser/index.d.ts:63


scriptingEnabled

Optional scriptingEnabled: boolean

The scripting flag. If set to true, noscript element content will be parsed as text.

Default

true

Inherited from

Parse5ParserOptions.scriptingEnabled

Defined in

node_modules/parse5/dist/cjs/parser/index.d.ts:40


sourceCodeLocationInfo

Optional sourceCodeLocationInfo: boolean

Enables source code location information. When enabled, each node (except the root node) will have a sourceCodeLocation property. If the node is not an empty element, sourceCodeLocation will be a ElementLocation object, otherwise it will be Location. If the element was implicitly created by the parser (as part of tree correction), its sourceCodeLocation property will be undefined.

Default

false

Inherited from

Parse5ParserOptions.sourceCodeLocationInfo

Defined in

node_modules/parse5/dist/cjs/parser/index.d.ts:51


treeAdapter

Optional treeAdapter: TreeAdapter<Htmlparser2TreeAdapterMap>

Specifies the resulting tree format.

Default

treeAdapters.default

Inherited from

Parse5ParserOptions.treeAdapter

Defined in

node_modules/parse5/dist/cjs/parser/index.d.ts:57