Skip to main content

BlockParserConfig

@blockslides/core


@blockslides/core / BlockParserConfig

Interface: BlockParserConfig

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:19

Properties

itemPattern

itemPattern: RegExp

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:21

Regex pattern to match block items


extractItemData()

extractItemData: (match) => object

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:23

Function to extract data from regex match

Parameters

match

RegExpMatchArray

Returns

object

mainContent

mainContent: string

indentLevel

indentLevel: number


createToken()

createToken: (data, nestedTokens?) => ParsedBlock

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:29

Function to create the final token

Parameters

data

any

nestedTokens?

any[]

Returns

ParsedBlock


baseIndentSize?

optional baseIndentSize: number

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:31

Base indentation to remove from nested content (default: 2 spaces)


customNestedParser()?

optional customNestedParser: (dedentedContent) => any[] | undefined

Defined in: blockslides/packages/core/src/utilities/markdown/parseIndentedBlocks.ts:37

Custom parser for nested content. If provided, this will be called instead of the default lexer.blockTokens() for parsing nested content. This allows recursive parsing of the same block type.

Parameters

dedentedContent

string

Returns

any[] | undefined