Skip to content

ParseContext

Defined in: packages/speculator/src/parse/registry.ts:42

Context provided to parser modules during transformation.

readonly registry: ParseHandlerRegistry

Defined in: packages/speculator/src/parse/registry.ts:62

Registry being used for parsing


readonly unit: SourceUnit

Defined in: packages/speculator/src/parse/registry.ts:44

The source unit being parsed

createSourcePos(node): SourcePos

Defined in: packages/speculator/src/parse/registry.ts:47

Create a source position for the AST node

NodeWithPosition

SourcePos


getAttr(element, name): string | undefined

Defined in: packages/speculator/src/parse/registry.ts:59

Get attribute value (HTML)

Element

string

string | undefined


getTextContent(element): string

Defined in: packages/speculator/src/parse/registry.ts:56

Get text content of element (HTML)

Element

string


transformBlockChildren(children): (Section | Block)[]

Defined in: packages/speculator/src/parse/registry.ts:53

Transform an array of mdast/hast block children

ParseContextChildren

(Section | Block)[]


transformInlineChildren(children): Inline[]

Defined in: packages/speculator/src/parse/registry.ts:50

Transform an array of mdast/hast inline children

ParseContextChildren

Inline[]