java.lang.Object
org.commonmark.parser.block.BlockStart
- Direct Known Subclasses:
BlockStartImpl
Result object for starting parsing of a block, see static methods for constructors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BlockStartatColumn(int newColumn) Continue parsing at the specified column (for tab handling).abstract BlockStartatIndex(int newIndex) Continue parsing at the specified index.static BlockStartnone()Result for when there is no block start.static BlockStartof(BlockParser... blockParsers) Start block(s) with the specified parser(s).abstract BlockStartDeprecated.abstract BlockStartreplaceParagraphLines(int lines) Replace a number of lines from the current paragraph (as returned byMatchedBlockParser.getParagraphLines()) with the new block.
-
Constructor Details
-
BlockStart
protected BlockStart()
-
-
Method Details
-
none
Result for when there is no block start. -
of
Start block(s) with the specified parser(s). -
atIndex
Continue parsing at the specified index.- Parameters:
newIndex- the new index, seeParserState.getIndex()
-
atColumn
Continue parsing at the specified column (for tab handling).- Parameters:
newColumn- the new column, seeParserState.getColumn()
-
replaceActiveBlockParser
Deprecated.usereplaceParagraphLines(int)instead; please raise an issue if that doesn't work for you for some reason. -
replaceParagraphLines
Replace a number of lines from the current paragraph (as returned byMatchedBlockParser.getParagraphLines()) with the new block.This is useful for parsing blocks that start with normal paragraphs and only have special marker syntax in later lines, e.g. in this:
Foo ===
TheFooline is initially parsed as a normal paragraph, then===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.
- Parameters:
lines- the number of lines to replace (at least 1); useInteger.MAX_VALUEto replace the whole paragraph
-
replaceParagraphLines(int)instead; please raise an issue if that doesn't work for you for some reason.