本文整理汇总了Java中org.commonmark.parser.block.ParserState类的典型用法代码示例。如果您正苦于以下问题:Java ParserState类的具体用法?Java ParserState怎么用?Java ParserState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParserState类属于org.commonmark.parser.block包,在下文中一共展示了ParserState类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tryContinue
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState parserState) {
final BlockContinue blockContinue;
final String line = line(parserState);
final int currentIndent = parserState.getIndent();
if (currentIndent > indent) {
indent += 2;
} else if (currentIndent < indent && indent > 1) {
indent -= 2;
}
if (line != null
&& line.length() > 0
&& PATTERN.matcher(line).matches()) {
blockContinue = BlockContinue.atIndex(parserState.getIndex());
} else {
blockContinue = BlockContinue.finished();
}
return blockContinue;
}
示例2: tryContinue
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
if (state.isBlank()) {
if (block.getFirstChild() == null) {
// Blank line after empty list item
return BlockContinue.none();
} else {
return BlockContinue.atIndex(state.getNextNonSpaceIndex());
}
}
if (state.getIndent() >= contentIndent) {
return BlockContinue.atColumn(state.getColumn() + contentIndent);
} else {
return BlockContinue.none();
}
}
示例3: tryStart
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) {
CharSequence line = state.getLine();
CharSequence previousLine = matchedBlockParser.getParagraphContent();
if (previousLine != null && previousLine.toString().contains("|")) {
line = line.subSequence(state.getIndex(), line.length());
ImmutableList<Alignment> columnAlignments = parseHeaderDivider(line);
if (!columnAlignments.isEmpty()) {
return BlockStart.of(new TableBlockParser(previousLine, columnAlignments))
.atIndex(state.getIndex())
.replaceActiveBlockParser();
}
}
return BlockStart.none();
}
示例4: line
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Nullable
private static String line(@NonNull ParserState state) {
final CharSequence lineRaw = state.getLine();
return lineRaw != null
? lineRaw.toString()
: null;
}
示例5: tryContinue
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
if (!state.isBlank()) {
return BlockContinue.atIndex(state.getIndex());
} else {
return BlockContinue.none();
}
}
示例6: tryContinue
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
if (state.getLine().toString().contains("|")
|| CAPTION_LINE.matcher(state.getLine()).matches()) {
return BlockContinue.atIndex(state.getIndex());
} else {
return BlockContinue.none();
}
}
示例7: tryContinue
import org.commonmark.parser.block.ParserState; //导入依赖的package包/类
@Override
public BlockContinue tryContinue(ParserState state) {
return BlockContinue.atIndex(state.getIndex());
}