public Rule BlockQuote() { StringBuilderVar inner = new StringBuilderVar(); StringBuilderVar optional = new StringBuilderVar(); return NodeSequence( OneOrMore( CrossedOut(Sequence('>', Optional(' ')), inner), Line(inner), ZeroOrMore( TestNot('>'), TestNot(BlankLine()), Line(inner) ), // ZeroOrMore(BlankLine()), inner.append(match()) Optional(Sequence(OneOrMore(BlankLine()), optional.append(match()), Test('>')), inner.append(optional.getString()) && optional.clearContents()) ), // vsch: the block quotes won't parse into Para because they will not be followed by a blank line, // unless the last line of the block quote is an empty block-quote line: ">". We append one here to // take care of that possibility, now that we don't include blank lines after a block quote we add one extra inner.append("\n\n"), // trigger a recursive parsing run on the inner source we just built // and attach the root of the inner parses AST push(new BlockQuoteNode(withIndicesShifted(parseInternal(inner), (Integer) peek()).getChildren())) ); }
title = null; java.util.List<Node> children = bqn.getChildren(); findByClass(bqn.getChildren().get(0), StrongEmphSuperNode.class, new FindPredicate<StrongEmphSuperNode>() { bqn.getChildren().remove(0); visitChildren(bqn); _buffer.append( format("\n{%s}\n", element) ).append('\n');
title = null; java.util.List<Node> children = bqn.getChildren(); findByClass(bqn.getChildren().get(0), StrongEmphSuperNode.class, new FindPredicate<StrongEmphSuperNode>() { bqn.getChildren().remove(0); visitChildren(bqn); _buffer.append( format("\n{%s}\n", element) ).append('\n');
title = null; List<Node> children = bqn.getChildren(); findByClass(bqn.getChildren().get(0), StrongEmphSuperNode.class, new FindPredicate<StrongEmphSuperNode>() { bqn.getChildren().remove(0); visitChildren(bqn); _buffer.append( format("\n{%s}\n", element) ).append('\n');