ListBlock listBlock = createListBlock(matcher);
@Override public void closeBlock(ParserState state) { finalizeListTight(state); if (state.getProperties().get(BLANK_LINES_IN_AST)) { // need to transfer trailing blank line nodes from last item to parent list ListBlock block = getBlock(); Node child = block.getFirstChildAnyNot(BlankLine.class); while (child instanceof ListItem) { // transfer its trailing blank lines to us child.moveTrailingBlankLines(); child = child.getNextAnyNot(BlankLine.class); } } myBlock.setCharsFromContentOnly(); }
listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(newColumn); } else { ListBlockParser.ListData listData = ListBlockParser.parseListMarker(myOptions, myOptions.getCodeIndent(), state); listBlockParser.setItemHandledLineSkipActive(state.getLine()); return continueAtColumn(newColumn); } else { listBlockParser.setItemHandledNewListLine(state.getLine()); return continueAtColumn(newColumn); listBlockParser.setItemHandledLine(state.getLine()); return BlockContinue.none(); } else { listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(newColumn); listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(state.getColumn() + currentIndent); } else { if (!overrideSubList && myOptions.startSubList(listBlockParser.getBlock(), listData.listBlock)) { listBlockParser.setItemHandledNewListLine(state.getLine()); return continueAtColumn(state.getColumn() + currentIndent); } else { if (myOptions.startNewList(listBlockParser.getBlock(), listData.listBlock)) {
private void finalizeListTight(ParserState parserState) { Node item = getBlock().getFirstChild(); boolean isTight = true; boolean prevItemHadBlankAfterItemPara = false; if (hasNonItemChildren((ListItem) item)) { thisItemHadChildren = true; if (!haveNestedList && getBlock().getAncestorOfType(ListBlock.class) == null && !isTight) { setTight(false); setTight(false);
if (listBlockParser.myItemHandledNewListLine) { ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListItemParser listItemParser = new ListItemParser(myOptions, state.getParsing(), listData); listBlockParser = new ListBlockParser(myOptions, listData, listItemParser); return BlockStart.of(listBlockParser, listItemParser).atColumn(newColumn); } else if (listBlockParser.myItemHandledNewItemLine) { ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListItemParser listItemParser = new ListItemParser(myOptions, state.getParsing(), listData); ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListBlockParser listBlockParser = new ListBlockParser(myOptions, listData, listItemParser); return BlockStart.of(listBlockParser, listItemParser).atColumn(newColumn);
private void finalizeListTight(ParserState parserState) { Node item = getBlock().getFirstChild(); boolean isTight = true; boolean prevItemHadBlankAfterItemPara = false; if (hasNonItemChildren((ListItem) item)) { thisItemHadChildren = true; if (!haveNestedList && getBlock().getAncestorOfType(ListBlock.class) == null && !isTight) { setTight(false); setTight(false);
if (listBlockParser.myItemHandledNewListLine) { ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListItemParser listItemParser = new ListItemParser(myOptions, state.getParsing(), listData); listBlockParser = new ListBlockParser(myOptions, listData, listItemParser); return BlockStart.of(listBlockParser, listItemParser).atColumn(newColumn); } else if (listBlockParser.myItemHandledNewItemLine) { ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListItemParser listItemParser = new ListItemParser(myOptions, state.getParsing(), listData); ListData listData = parseListMarker(myOptions, newItemCodeIndent, state); ListBlockParser listBlockParser = new ListBlockParser(myOptions, listData, listItemParser); return BlockStart.of(listBlockParser, listItemParser).atColumn(newColumn);
listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(newColumn); } else { ListBlockParser.ListData listData = ListBlockParser.parseListMarker(myOptions, myOptions.getCodeIndent(), state); listBlockParser.setItemHandledLineSkipActive(state.getLine()); return continueAtColumn(newColumn); } else { listBlockParser.setItemHandledNewListLine(state.getLine()); return continueAtColumn(newColumn); listBlockParser.setItemHandledLine(state.getLine()); return BlockContinue.none(); } else { listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(newColumn); listBlockParser.setItemHandledLine(state.getLine()); return continueAtColumn(state.getColumn() + currentIndent); } else { if (!overrideSubList && myOptions.startSubList(listBlockParser.getBlock(), listData.listBlock)) { listBlockParser.setItemHandledNewListLine(state.getLine()); return continueAtColumn(state.getColumn() + currentIndent); } else { if (myOptions.startNewList(listBlockParser.getBlock(), listData.listBlock)) {
@Override public void closeBlock(ParserState state) { finalizeListTight(state); if (state.getProperties().get(BLANK_LINES_IN_AST)) { // need to transfer trailing blank line nodes from last item to parent list ListBlock block = getBlock(); Node child = block.getFirstChildAnyNot(BlankLine.class); while (child instanceof ListItem) { // transfer its trailing blank lines to us child.moveTrailingBlankLines(); child = child.getNextAnyNot(BlankLine.class); } } myBlock.setCharsFromContentOnly(); }
ListBlock listBlock = createListBlock(matcher);