BlockStart
@Js
class BlockStart : Obj
Resulting object for starting parsing of a block. See BlockParserFactory.
Result when there is no block start
Start block(s) with the specified parser(s)
Continue parsing at the specified column (for tab handling)
Continue parsing at the specified index
Replace a number of lines from the current paragraph (as returned by MatchedBlockParser.paragraphLines) with the new block
This atColumn(Int newColumn)
Continue parsing at the specified column (for tab handling)
This atIndex(Int newIndex)
Continue parsing at the specified index
BlockParser[] : blockParsers
Bool : isReplaceActiveBlockParser
Int : newColumn
Int : newIndex
static new none()
Result when there is no block start
static new of(BlockParser[] blockParsers)
Start block(s) with the specified parser(s)
@Deprecated { msg=... }
This replaceActiveBlockParser()
Int : replaceParagraphLines
This withReplaceParagraphLines(Int lines)
Replace a number of lines from the current paragraph (as returned by MatchedBlockParser.paragraphLines) with the new block.
This is useful for parsing blocks that start with normal paragrapsh and only have special marker syntax in later lines, e.g. in this:
## Foo
The Foo line is initially parsed as a normal paragraph, then the === is parsed
as a heading marker, replacing the 1 paragraph line before. The end result is a
single Heading block.
Note that source spans from the replaced lines are automatically added to the new block.
Paramter lines indicates the number of lines to replace (at least 1); use Int.maxVal
to replace the paragraph.