@Override public BlockPreProcessor create(ParserState state) { return new DefinitionListItemBlockPreProcessor(state.getProperties()); } }
@Override public BlockPreProcessor create(ParserState state) { return new ZzzzzzBlockPreProcessor(state.getProperties()); } }
@Override public ParagraphPreProcessor create(ParserState state) { return new AbbreviationParagraphPreProcessor(state.getProperties()); } };
@Override public BlockPreProcessor create(ParserState state) { return new DefinitionListBlockPreProcessor(state.getProperties()); } }
@Override public BlockPreProcessor create(ParserState state) { return new TaskListItemBlockPreProcessor(state.getProperties()); } }
@Override public ParagraphPreProcessor create(ParserState state) { return new TableParagraphPreProcessor(state.getProperties()); } };
@Override public ParagraphPreProcessor create(ParserState state) { return new ZzzzzzParagraphPreProcessor(state.getProperties()); } };
@Override public boolean canContain(ParserState state, BlockParser blockParser, Block block) { // Issue 66, fenced code can only be contained in GitHub Doc mode if it is indented more than list item if (block instanceof FencedCodeBlock) { // see if it indented more than our marker if (state.getProperties().get(PARSER_EMULATION_PROFILE) == GITHUB_DOC) { // Issue #66, if we are in a list item and our indent == list indent then we interrupt the list FencedCodeBlockParser parser = (FencedCodeBlockParser)blockParser; return myListData.markerIndent < parser.getFenceMarkerIndent(); } } return true; }
@Override public void closeBlock(ParserState state) { if (state.getProperties().get(TRACK_DOCUMENT_LINES)) { document.setContent(state.getLineSegments()); } } }
@Override public void closeBlock(ParserState state) { block.setCharsFromContent(); if (!state.getProperties().get(Parser.BLANK_LINES_IN_AST)) { removeBlankLines(); } }
@Override public void closeBlock(ParserState state) { block.setCharsFromContent(); if (!state.getProperties().get(Parser.BLANK_LINES_IN_AST)) { removeBlankLines(); } }
@Override public void closeBlock(ParserState state) { // add it to the map AbbreviationRepository abbreviationMap = state.getProperties().get(AbbreviationExtension.ABBREVIATIONS); abbreviationMap.put(abbreviationMap.normalizeKey(block.getText()).toString(), block); }
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { BasedSequence line = state.getLine(); if (ZZZZZZ_BLOCK_START.matcher(line).matches()) { return BlockStart.of(new ZzzzzzBlockParser(state.getProperties())) .atIndex(state.getIndex()) //.replaceActiveBlockParser() ; } return BlockStart.none(); } }
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { BasedSequence line = state.getLine(); if (state.getIndex() == 0) { int breakLength = myOptions.exampleBreak.length(); if (line.length() >= breakLength + 1 + EXAMPLE_KEYWORD.length() && line.startsWith(myOptions.exampleBreak) && line.matchChars(EXAMPLE_KEYWORD, breakLength + 1) && " \t\u00A0".contains(String.valueOf(line.charAt(breakLength)))) { SpecExampleBlockParser blockParser = new SpecExampleBlockParser(state.getProperties()); blockParser.block.setOpeningMarker(line.subSequence(0, breakLength)); //blockParser.addLine(state, state.getLineWithEOL()); return BlockStart.of(blockParser).atIndex(-1); } } return BlockStart.none(); } }
@Override public BlockStart tryStart(ParserState state, MatchedBlockParser matchedBlockParser) { BasedSequence line = state.getLine(); BlockParser parentParser = matchedBlockParser.getBlockParser(); if (parentParser instanceof DocumentBlockParser && parentParser.getBlock().getFirstChild() == null) { Matcher matcher = JEKYLL_FRONT_MATTER_BLOCK_START.matcher(line); if (matcher.matches()) { BasedSequence openingMarker = line.subSequence(0, 3); JekyllFrontMatterBlockParser parser = new JekyllFrontMatterBlockParser(state.getProperties(), openingMarker); return BlockStart.of(parser).atIndex(-1); } } return BlockStart.none(); } }
@Override public void closeBlock(ParserState state) { block.setContent(content); block.setCharsFromContent(); content = null; // set the footnote from closingMarker to end block.setCharsFromContent(); // add it to the map MacroDefinitionRepository macrosRepository = state.getProperties().get(MacrosExtension.MACRO_DEFINITIONS); macrosRepository.put(macrosRepository.normalizeKey(block.getName()), block); }
@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(); }
@Override public void closeBlock(ParserState state) { // set the enumeratedReference from closingMarker to end block.setCharsFromContent(); block.setEnumeratedReference(block.getChars().subSequence(block.getClosingMarker().getEndOffset() - block.getChars().getStartOffset()).trimStart()); content = null; // add block to reference repository final EnumeratedReferenceRepository enumeratedReferences = EnumeratedReferenceExtension.ENUMERATED_REFERENCES.getFrom(state.getProperties()); enumeratedReferences.put(block.getText().toString(), block); }
@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(); } } }
@Override public void closeBlock(ParserState state) { // set the footnote from closingMarker to end block.setCharsFromContent(); block.setFootnote(block.getChars().subSequence(block.getClosingMarker().getEndOffset() - block.getChars().getStartOffset()).trimStart()); // add it to the map FootnoteRepository footnoteMap = state.getProperties().get(FootnoteExtension.FOOTNOTES); footnoteMap.put(footnoteMap.normalizeKey(block.getText()), block); content = null; }