public MarkdownWriter tailBlankLine(int count) { Node node = context.getCurrentNode(); if (isLastBlockQuoteChild(node)) { if (getPushedPrefixCount() > 0) { flush(-1); // clear pending lines so pop prefix is not delayed, if PREFIX_AFTER_PENDING_EOL is enabled popPrefix(); pushPrefix(); } } blankLine(count); return this; }
@Override public void renderReferenceBlock(final FootnoteBlock node, final NodeFormatterContext context, final MarkdownWriter markdown) { markdown.blankLine().append("[^"); markdown.append(transformReferenceId(node.getText().toString(), context)); markdown.append("]: "); markdown.pushPrefix().addPrefix(" "); context.renderChildren(node); markdown.popPrefix(); markdown.blankLine(); }
markdown.pushPrefix();
@Override public void renderReferenceBlock(final EnumeratedReferenceBlock node, final NodeFormatterContext context, final MarkdownWriter markdown) { markdown.blankLine().append("[@").appendNonTranslating(node.getText()).append("]: "); markdown.pushPrefix().addPrefix(" "); context.renderChildren(node); markdown.popPrefix(); markdown.blankLine(); }
private void render(Text node, NodeFormatterContext context, MarkdownWriter markdown) { //if (TABLE_HEADER_SEPARATOR.matcher(node.getChars()).matches()) { if (myTable != null && myTable.isSeparator()) { Node parent = node.getAncestorOfType(Paragraph.class); if (parent instanceof Paragraph && ((Paragraph) parent).hasTableSeparator()) { markdown.pushPrefix().addPrefix(" ").append(node.getChars()).popPrefix(); } else { markdown.append(node.getChars()); } } else { markdown.append(node.getChars()); } }
markdown.pushPrefix().addPrefix(options.itemContentIndent ? RepeatedCharSequence.of(' ', openingMarker.length() + (listOptions.isItemContentAfterSuffix() ? markerSuffix.length() : 0) + 1) : RepeatedCharSequence.of(" ", listOptions.getItemIndent()).toString());
private void render(final AdmonitionBlock node, final NodeFormatterContext context, MarkdownWriter markdown) { markdown.blankLine(); markdown.append(node.getOpeningMarker()).append(' '); markdown.appendNonTranslating(node.getInfo()); if (node.getTitle().isNotNull()) { markdown.append(' ').append('"').appendTranslating(node.getTitle()).append('"'); } markdown.line(); markdown.pushPrefix().addPrefix(RepeatedCharSequence.of(" ", options.contentIndent).toString()); context.renderChildren(node); markdown.blankLine(); markdown.popPrefix(); }
markdown.pushPrefix().addPrefix(prefix); markdown.openPreFormatted(true); if (context.isTransformingText()) {
private void render(final DefinitionItem node, final NodeFormatterContext context, final MarkdownWriter markdown) { BasedSequence openMarkerChars = node.getChars().prefixOf(node.getFirstChild().getChars()); BasedSequence openMarker = openMarkerChars.subSequence(0,1); BasedSequence openMarkerSpaces = openMarkerChars.subSequence(1); if (options.markerSpaces >= 1 && openMarkerSpaces.length() != options.markerSpaces) { openMarkerSpaces = SubSequence.of(RepeatedCharSequence.of(' ', options.markerSpaces)); } switch (options.markerType) { case ANY: break; case COLON: openMarker = SubSequence.of(":"); break; case TILDE: openMarker = SubSequence.of("~"); break; } markdown.line().append(openMarker).append(openMarkerSpaces); markdown.pushPrefix().addPrefix(RepeatedCharSequence.of(' ', context.getFormatterOptions().itemContentIndent ? openMarker.length() + openMarkerSpaces.length() : listOptions.getItemIndent())); context.renderChildren(node); markdown.popPrefix(); if (!context.getOptions().get(BLANK_LINES_IN_AST)) { // add blank lines after last paragraph item Node child = node.getLastChild(); if (child instanceof Paragraph && ((Paragraph) child).isTrailingBlankLine()) { markdown.blankLine(); } } }
public MarkdownWriter tailBlankLine(int count) { Node node = context.getCurrentNode(); if (isLastBlockQuoteChild(node)) { if (getPushedPrefixCount() > 0) { flush(-1); // clear pending lines so pop prefix is not delayed, if PREFIX_AFTER_PENDING_EOL is enabled popPrefix(); pushPrefix(); } } blankLine(count); return this; }
@Override public void renderReferenceBlock(final FootnoteBlock node, final NodeFormatterContext context, final MarkdownWriter markdown) { markdown.blankLine().append("[^"); markdown.append(transformReferenceId(node.getText().toString(), context)); markdown.append("]: "); markdown.pushPrefix().addPrefix(" "); context.renderChildren(node); markdown.popPrefix(); markdown.blankLine(); }
private void render(Text node, NodeFormatterContext context, MarkdownWriter markdown) { //if (TABLE_HEADER_SEPARATOR.matcher(node.getChars()).matches()) { if (myTable != null && myTable.isSeparator()) { Node parent = node.getAncestorOfType(Paragraph.class); if (parent instanceof Paragraph && ((Paragraph) parent).hasTableSeparator()) { markdown.pushPrefix().addPrefix(" ").append(node.getChars()).popPrefix(); } else { markdown.append(node.getChars()); } } else { markdown.append(node.getChars()); } }
markdown.pushPrefix().addPrefix(options.itemContentIndent ? RepeatedCharSequence.of(' ', openingMarker.length() + (listOptions.isItemContentAfterSuffix() ? markerSuffix.length() : 0) + 1) : RepeatedCharSequence.of(" ", listOptions.getItemIndent()).toString());
markdown.pushPrefix().addPrefix(prefix); markdown.openPreFormatted(true); if (context.isTransformingText()) {
private void render(final DefinitionItem node, final NodeFormatterContext context, final MarkdownWriter markdown) { BasedSequence openMarkerChars = node.getChars().prefixOf(node.getFirstChild().getChars()); BasedSequence openMarker = openMarkerChars.subSequence(0,1); BasedSequence openMarkerSpaces = openMarkerChars.subSequence(1); if (options.markerSpaces >= 1 && openMarkerSpaces.length() != options.markerSpaces) { openMarkerSpaces = SubSequence.of(RepeatedCharSequence.of(' ', options.markerSpaces)); } switch (options.markerType) { case ANY: break; case COLON: openMarker = SubSequence.of(":"); break; case TILDE: openMarker = SubSequence.of("~"); break; } markdown.line().append(openMarker).append(openMarkerSpaces); markdown.pushPrefix().addPrefix(RepeatedCharSequence.of(' ', context.getFormatterOptions().itemContentIndent ? openMarker.length() + openMarkerSpaces.length() : listOptions.getItemIndent())); context.renderChildren(node); markdown.popPrefix(); if (!context.getOptions().get(BLANK_LINES_IN_AST)) { // add blank lines after last paragraph item Node child = node.getLastChild(); if (child instanceof Paragraph && ((Paragraph) child).isTrailingBlankLine()) { markdown.blankLine(); } } }