@Override public BlockContinue tryContinue(ParserState state) { int nextNonSpace = state.getNextNonSpaceIndex(); boolean isMarker; if (!state.isBlank() && ((isMarker = isMarker(state, nextNonSpace)) || (continueToBlankLine && lastWasBlankLine == 0))) { int newColumn = state.getColumn() + state.getIndent(); lastWasBlankLine = 0; if (isMarker) { newColumn++; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } } return BlockContinue.atColumn(newColumn); } else { if (ignoreBlankLine && state.isBlank()) { lastWasBlankLine++; int newColumn = state.getColumn() + state.getIndent(); return BlockContinue.atColumn(newColumn); } return BlockContinue.none(); } }
@Override public BlockContinue tryContinue(ParserState state) { int nextNonSpace = state.getNextNonSpaceIndex(); boolean isMarker; if (!state.isBlank() && ((isMarker = isMarker(state, nextNonSpace, false, false, allowLeadingSpace, interruptsParagraph, interruptsItemParagraph, withLeadSpacesInterruptsItemParagraph)) || (continueToBlankLine && lastWasBlankLine == 0))) { int newColumn = state.getColumn() + state.getIndent(); lastWasBlankLine = 0; if (isMarker) { newColumn++; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } } return BlockContinue.atColumn(newColumn); } else { if (ignoreBlankLine && state.isBlank()) { lastWasBlankLine++; int newColumn = state.getColumn() + state.getIndent(); return BlockContinue.atColumn(newColumn); } return BlockContinue.none(); } }
@Override public BlockContinue tryContinue(ParserState state) { if (state.getIndent() >= state.getParsing().CODE_BLOCK_INDENT) { return BlockContinue.atColumn(state.getColumn() + state.getParsing().CODE_BLOCK_INDENT); } else if (state.isBlank()) { return BlockContinue.atIndex(state.getNextNonSpaceIndex()); } else { return BlockContinue.none(); } }
@Override public BlockContinue tryContinue(ParserState state) { final int nonSpaceIndex = state.getNextNonSpaceIndex(); if (state.isBlank()) { hadBlankLine = true; return BlockContinue.atIndex(nonSpaceIndex); } else if (!hadBlankLine && options.allowLazyContinuation) { return BlockContinue.atIndex(nonSpaceIndex); } else if (state.getIndent() >= options.contentIndent) { int contentIndent = state.getColumn() + options.contentIndent; return BlockContinue.atColumn(contentIndent); } else { return BlockContinue.none(); } }
BasedSequence line = state.getLine(); int markerIndex = state.getNextNonSpaceIndex(); int markerColumn = state.getColumn() + state.getIndent(); int markerIndent = state.getIndent();
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { // An indented code block cannot interrupt a paragraph. if (state.getIndent() >= state.getParsing().CODE_BLOCK_INDENT && !state.isBlank() && !(state.getActiveBlockParser().getBlock() instanceof Paragraph)) { return BlockStart.of(new IndentedCodeBlockParser(state.getProperties())).atColumn(state.getColumn() + state.getParsing().CODE_BLOCK_INDENT); } else { return BlockStart.none(); } } }
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { int nextNonSpace = state.getNextNonSpaceIndex(); if (isMarker(state, nextNonSpace) && !endsWithMarker(state.getLine())) { int newColumn = state.getColumn() + state.getIndent() + 1; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } return BlockStart.of(new AsideBlockParser(state.getProperties(), state.getLine().subSequence(nextNonSpace, nextNonSpace + 1))).atColumn(newColumn); } else { return BlockStart.none(); } } }
static ItemData parseItemMarker(DefinitionOptions options, ParserState state, boolean isTight) { BasedSequence line = state.getLine(); int markerIndex = state.getNextNonSpaceIndex(); int markerColumn = state.getColumn() + state.getIndent(); int markerIndent = state.getIndent();
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { int nextNonSpace = state.getNextNonSpaceIndex(); BlockParser matched = matchedBlockParser.getBlockParser(); boolean inParagraph = matched.isParagraphParser(); boolean inParagraphListItem = inParagraph && matched.getBlock().getParent() instanceof ListItem && matched.getBlock() == matched.getBlock().getParent().getFirstChild(); if (isMarker(state, nextNonSpace, inParagraph, inParagraphListItem, allowLeadingSpace, interruptsParagraph, interruptsItemParagraph, withLeadSpacesInterruptsItemParagraph)) { int newColumn = state.getColumn() + state.getIndent() + 1; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } return BlockStart.of(new BlockQuoteParser(state.getProperties(), state.getLine().subSequence(nextNonSpace, nextNonSpace + 1))).atColumn(newColumn); } else { return BlockStart.none(); } } }
int newColumn = state.getColumn() + contentIndent; return continueAtColumn(state.getColumn() + currentIndent); } else { return continueAtColumn(state.getColumn() + currentIndent); } else { if (myOptions.startNewList(listBlockParser.getBlock(), listData.listBlock)) { int newColumn = state.getColumn() + itemIndent; return continueAtColumn(state.getColumn() + currentIndent); } else { return continueAtColumn(state.getColumn() + currentIndent); } else { return continueAtColumn(state.getColumn() + currentIndent); } else { if (myOptions.startNewList(listBlockParser.getBlock(), listData.listBlock)) { int newColumn = state.getColumn() + contentIndent; return continueAtColumn(state.getColumn() + currentIndent); return continueAtColumn(state.getColumn() + currentIndent); } else { if (myOptions.startNewList(listBlockParser.getBlock(), listData.listBlock)) {
@Override public BlockContinue tryContinue(ParserState state) { int nextNonSpace = state.getNextNonSpaceIndex(); boolean isMarker; if (!state.isBlank() && ((isMarker = isMarker(state, nextNonSpace, false, false, allowLeadingSpace, interruptsParagraph, interruptsItemParagraph, withLeadSpacesInterruptsItemParagraph)) || (continueToBlankLine && lastWasBlankLine == 0))) { int newColumn = state.getColumn() + state.getIndent(); lastWasBlankLine = 0; if (isMarker) { newColumn++; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } } return BlockContinue.atColumn(newColumn); } else { if (ignoreBlankLine && state.isBlank()) { lastWasBlankLine++; int newColumn = state.getColumn() + state.getIndent(); return BlockContinue.atColumn(newColumn); } return BlockContinue.none(); } }
@Override public BlockContinue tryContinue(ParserState state) { if (state.getIndent() >= state.getParsing().CODE_BLOCK_INDENT) { return BlockContinue.atColumn(state.getColumn() + state.getParsing().CODE_BLOCK_INDENT); } else if (state.isBlank()) { return BlockContinue.atIndex(state.getNextNonSpaceIndex()); } else { return BlockContinue.none(); } }
@Override public BlockContinue tryContinue(ParserState state) { int nextNonSpace = state.getNextNonSpaceIndex(); boolean isMarker; if (!state.isBlank() && ((isMarker = isMarker(state, nextNonSpace)) || (continueToBlankLine && lastWasBlankLine == 0))) { int newColumn = state.getColumn() + state.getIndent(); lastWasBlankLine = 0; if (isMarker) { newColumn++; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } } return BlockContinue.atColumn(newColumn); } else { if (ignoreBlankLine && state.isBlank()) { lastWasBlankLine++; int newColumn = state.getColumn() + state.getIndent(); return BlockContinue.atColumn(newColumn); } return BlockContinue.none(); } }
BasedSequence line = state.getLine(); int markerIndex = state.getNextNonSpaceIndex(); int markerColumn = state.getColumn() + state.getIndent(); int markerIndent = state.getIndent();
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { // An indented code block cannot interrupt a paragraph. if (state.getIndent() >= state.getParsing().CODE_BLOCK_INDENT && !state.isBlank() && !(state.getActiveBlockParser().getBlock() instanceof Paragraph)) { return BlockStart.of(new IndentedCodeBlockParser(state.getProperties())).atColumn(state.getColumn() + state.getParsing().CODE_BLOCK_INDENT); } else { return BlockStart.none(); } } }
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { int nextNonSpace = state.getNextNonSpaceIndex(); if (isMarker(state, nextNonSpace) && !endsWithMarker(state.getLine())) { int newColumn = state.getColumn() + state.getIndent() + 1; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } return BlockStart.of(new AsideBlockParser(state.getProperties(), state.getLine().subSequence(nextNonSpace, nextNonSpace + 1))).atColumn(newColumn); } else { return BlockStart.none(); } } }
static ItemData parseItemMarker(DefinitionOptions options, ParserState state, boolean isTight) { BasedSequence line = state.getLine(); int markerIndex = state.getNextNonSpaceIndex(); int markerColumn = state.getColumn() + state.getIndent(); int markerIndent = state.getIndent();
public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { int nextNonSpace = state.getNextNonSpaceIndex(); BlockParser matched = matchedBlockParser.getBlockParser(); boolean inParagraph = matched.isParagraphParser(); boolean inParagraphListItem = inParagraph && matched.getBlock().getParent() instanceof ListItem && matched.getBlock() == matched.getBlock().getParent().getFirstChild(); if (isMarker(state, nextNonSpace, inParagraph, inParagraphListItem, allowLeadingSpace, interruptsParagraph, interruptsItemParagraph, withLeadSpacesInterruptsItemParagraph)) { int newColumn = state.getColumn() + state.getIndent() + 1; // optional following space or tab if (Parsing.isSpaceOrTab(state.getLine(), nextNonSpace + 1)) { newColumn++; } return BlockStart.of(new BlockQuoteParser(state.getProperties(), state.getLine().subSequence(nextNonSpace, nextNonSpace + 1))).atColumn(newColumn); } else { return BlockStart.none(); } } }