abstract class markdown::BlockParser

sys::Obj
  markdown::BlockParser

@Js

Source

A block parser is able to parse a specific block node.

addLine

virtual Void addLine(SourceLine line)

Source

Default implementation does nothing with the source line

addSourceSpan

virtual Void addSourceSpan(SourceSpan sourceSpan)

Source

Add a source span of the currently parsed block. The default implementation adds it to the block. Unless you have some complicated parsing where you need to check source positions, you don't need to override this.

block

abstract Block block()

Source

Get the parsed block

canContain

virtual Bool canContain(Block childBlock)

Source

Return true if the this block may contain the child block; false otherwise (default)

canHaveLazyContinuationLines

virtual Bool canHaveLazyContinuationLines()

Source

Return true if the block can have lazy continuation lines.

Lazy continuation lines are lines that were rejected by this tryContinue but didn't match any other block parser either.

If true is returned here, those lines will get added via addLine. For false (default), the block is closed instead.

closeBlock

virtual Void closeBlock()

Source

Do any processing when the block is closed

definitions

virtual DefinitionMap[] definitions()

Source

Return the definitions parsed by this parser. The definitions returned here can later be accessed during inline parsing.

isContainer

virtual Bool isContainer()

Source

Return true if the block that is parsed is a container (i.e. contains other blocks), or false (default) if it's a leaf.

parseInlines

virtual Void parseInlines(InlineParser inlineParser)

Source

Callback to parse inline content

tryContinue

abstract BlockContinue? tryContinue(ParserState state)

Source

Attempt to continue parsing the block from the given state