BlockHandler
@hashml/hashml › Globals › "parser/BlockHandler" › BlockHandler
A BlockHandler
builds a data structure from instructions from the BlockParser.
Hierarchy
- BlockHandler
Implemented by
Index
Methods
Methods
closeBlock
▸ closeBlock(pos
: InputPosition): void
Defined in parser/BlockHandler.ts:33
Close the currently open block.
Parameters:
Name | Type | Description |
---|---|---|
pos | InputPosition | start position of the block |
Returns: void
head
▸ head(content
: string, pos
: InputPosition): void
Defined in parser/BlockHandler.ts:26
Receive the head content of the currently open block.
It is the responsibility of the block handler to further parse the head content (i.e. call the InlineParser if needed).
Parameters:
Name | Type | Description |
---|---|---|
content | string | raw content of the head |
pos | InputPosition | position of the head content |
Returns: void
openBlock
▸ openBlock(tag
: string | undefined, pos
: InputPosition): boolean
Defined in parser/BlockHandler.ts:15
Open a block tag.
Parameters:
Name | Type | Description |
---|---|---|
tag | string | undefined | name of the tag, or undefined if the tag is not explicitly named |
pos | InputPosition | position of the start of the block |
Returns: boolean
true
if the block body is parsed, false
otherwise
rawLine
▸ rawLine(content
: string, pos
: InputPosition): void
Defined in parser/BlockHandler.ts:40
Parameters:
Name | Type | Description |
---|---|---|
content | string | - |
pos | InputPosition |
Returns: void