Package org.commonmark.internal
Class FencedCodeBlockParser
- java.lang.Object
-
- org.commonmark.parser.block.AbstractBlockParser
-
- org.commonmark.internal.FencedCodeBlockParser
-
- All Implemented Interfaces:
BlockParser
public class FencedCodeBlockParser extends AbstractBlockParser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FencedCodeBlockParser.Factory
-
Field Summary
Fields Modifier and Type Field Description private FencedCodeBlock
block
private char
fenceChar
private java.lang.String
firstLine
private int
openingFenceLength
private java.lang.StringBuilder
otherLines
-
Constructor Summary
Constructors Constructor Description FencedCodeBlockParser(char fenceChar, int fenceLength, int fenceIndent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLine(SourceLine line)
Add the part of a line that belongs to this block parser to parse (i.e.private static FencedCodeBlockParser
checkOpener(java.lang.CharSequence line, int index, int indent)
void
closeBlock()
Block
getBlock()
private boolean
tryClosing(java.lang.CharSequence line, int index)
BlockContinue
tryContinue(ParserState state)
-
Methods inherited from class org.commonmark.parser.block.AbstractBlockParser
addSourceSpan, canContain, canHaveLazyContinuationLines, isContainer, parseInlines
-
-
-
-
Field Detail
-
block
private final FencedCodeBlock block
-
fenceChar
private final char fenceChar
-
openingFenceLength
private final int openingFenceLength
-
firstLine
private java.lang.String firstLine
-
otherLines
private java.lang.StringBuilder otherLines
-
-
Method Detail
-
getBlock
public Block getBlock()
-
tryContinue
public BlockContinue tryContinue(ParserState state)
-
addLine
public void addLine(SourceLine line)
Description copied from interface:BlockParser
Add the part of a line that belongs to this block parser to parse (i.e. without any container block markers). Note that the line will only include aSourceLine.getSourceSpan()
if source spans are enabled for inlines.- Specified by:
addLine
in interfaceBlockParser
- Overrides:
addLine
in classAbstractBlockParser
-
closeBlock
public void closeBlock()
- Specified by:
closeBlock
in interfaceBlockParser
- Overrides:
closeBlock
in classAbstractBlockParser
-
checkOpener
private static FencedCodeBlockParser checkOpener(java.lang.CharSequence line, int index, int indent)
-
tryClosing
private boolean tryClosing(java.lang.CharSequence line, int index)
-
-