@Override public boolean isParagraphWrappingDisabled(Paragraph node, ListOptions listOptions, DataHolder options) { assert node.getParent() == this; return listOptions.isInTightListItem(node); }
@Override public boolean isParagraphWrappingDisabled(Paragraph node, ListOptions listOptions, DataHolder options) { assert node.getParent() == this; // see if this is the first paragraph child item we handle our own paragraph wrapping for that one Node child = getFirstChild(); while (child != null && !(child instanceof Paragraph)) child = child.getNext(); return child == node; }
private void render(Paragraph node, NodeRendererContext context, HtmlWriter html) { if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseParagraph(node, context, html); } else { renderTextBlockParagraphLines(node, context, html); } }
private void render(Paragraph node, NodeRendererContext context, HtmlWriter html) { if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseParagraph(node, context, html); } else { renderTextBlockParagraphLines(node, context, html); } }
void render(final Paragraph node, final NodeRendererContext context, final HtmlWriter html) { if (node.getFirstChildAnyNot(NonRenderingInline.class) != null) { if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseParagraph(node, context, html); } else { renderTextBlockParagraphLines(node, context, html, false); //context.getHtmlOptions().wrapTightItemParagraphInSpan); } } }
private void render(final Paragraph node, final DocxRendererContext docx) { if (node.getParent() instanceof EnumeratedReferenceBlock) { // we need to unwrap the paragraphs //final String text = new TextCollectingVisitor().collectAndGetText(node); //if (!text.isEmpty()) { docx.renderChildren(node); //} } else if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isItemParagraph(node)) { if (node.getParent() instanceof BlockQuote || node.getParent() instanceof AsideBlock) { // the parent handles our formatting docx.createP(); docx.renderChildren(node); } else { if (node.getFirstChildAnyNot(NonRenderingInline.class) != null) { docx.setBlockFormatProvider(new BlockFormatProviderBase<>(docx, docx.getDocxRendererOptions().LOOSE_PARAGRAPH_STYLE)); docx.createP(); docx.renderChildren(node); } } } else { // the parent handles our formatting if (node.getParent() instanceof FootnoteBlock) { // there is already an open paragraph, re-use it docx.renderChildren(node); } else { docx.createP(); docx.renderChildren(node); } } }
private void render(final Paragraph node, final NodeFormatterContext context, final MarkdownWriter markdown) { if (node.getParent() instanceof ParagraphContainer) { final boolean startWrappingDisabled = ((ParagraphContainer) node.getParent()).isParagraphStartWrappingDisabled(node); final boolean endWrappingDisabled = ((ParagraphContainer) node.getParent()).isParagraphEndWrappingDisabled(node); if (startWrappingDisabled || endWrappingDisabled) { if (!startWrappingDisabled) markdown.blankLine(); if (!(node.getParent() instanceof ParagraphItemContainer)) { if (!node.isTrailingBlankLine() && (node.getNext() == null || node.getNext() instanceof ListBlock)) { renderTextBlockParagraphLines(node, context, markdown); boolean isItemParagraph = ((ParagraphItemContainer) node.getParent()).isItemParagraph(node); if (isItemParagraph) { ListSpacing itemSpacing = context.getDocument().get(LIST_ITEM_SPACING); renderTextBlockParagraphLines(node, context, markdown); } else if (itemSpacing == ListSpacing.LOOSE) { if (node.getParent().getNextAnyNot(BlankLine.class) == null) { renderTextBlockParagraphLines(node, context, markdown); } else { if (!((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseItemParagraph(node, context, markdown); } else {
public boolean isInTightListItem(Paragraph node) { Block parent = node.getParent(); if (!(parent instanceof ListItem)) return false; ListItem listItem = (ListItem) parent; if (!listItem.isItemParagraph(node)) return false; boolean autoLoose = isAutoLoose(); if (autoLoose && isAutoLooseOneLevelLists()) { return isTightListItem(listItem); } return !autoLoose && listItem.isParagraphInTightListItem(node) || autoLoose && listItem.isInTightList(); }
@Override public boolean isParagraphWrappingDisabled(Paragraph node, ListOptions listOptions, DataHolder options) { assert node.getParent() == this; return listOptions.isInTightListItem(node); }
private void render(Paragraph node, NodeRendererContext context, HtmlWriter html) { if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseParagraph(node, context, html); } else { renderTextBlockParagraphLines(node, context, html); } }
@Override public boolean isParagraphWrappingDisabled(Paragraph node, ListOptions listOptions, DataHolder options) { assert node.getParent() == this; // see if this is the first paragraph child item we handle our own paragraph wrapping for that one Node child = getFirstChild(); while (child != null && !(child instanceof Paragraph)) child = child.getNext(); return child == node; }
void render(final Paragraph node, final NodeRendererContext context, final HtmlWriter html) { if (node.getFirstChildAnyNot(NonRenderingInline.class) != null) { if (!(node.getParent() instanceof ParagraphItemContainer) || !((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseParagraph(node, context, html); } else { renderTextBlockParagraphLines(node, context, html, false); //context.getHtmlOptions().wrapTightItemParagraphInSpan); } } }
private void render(final Paragraph node, final NodeFormatterContext context, final MarkdownWriter markdown) { if (node.getParent() instanceof ParagraphContainer) { final boolean startWrappingDisabled = ((ParagraphContainer) node.getParent()).isParagraphStartWrappingDisabled(node); final boolean endWrappingDisabled = ((ParagraphContainer) node.getParent()).isParagraphEndWrappingDisabled(node); if (startWrappingDisabled || endWrappingDisabled) { if (!startWrappingDisabled) markdown.blankLine(); if (!(node.getParent() instanceof ParagraphItemContainer)) { if (!node.isTrailingBlankLine() && (node.getNext() == null || node.getNext() instanceof ListBlock)) { renderTextBlockParagraphLines(node, context, markdown); boolean isItemParagraph = ((ParagraphItemContainer) node.getParent()).isItemParagraph(node); if (isItemParagraph) { ListSpacing itemSpacing = context.getDocument().get(LIST_ITEM_SPACING); renderTextBlockParagraphLines(node, context, markdown); } else if (itemSpacing == ListSpacing.LOOSE) { if (node.getParent().getNextAnyNot(BlankLine.class) == null) { renderTextBlockParagraphLines(node, context, markdown); } else { if (!((ParagraphItemContainer) node.getParent()).isParagraphWrappingDisabled(node, listOptions, context.getOptions())) { renderLooseItemParagraph(node, context, markdown); } else {
public boolean isInTightListItem(Paragraph node) { Block parent = node.getParent(); if (!(parent instanceof ListItem)) return false; ListItem listItem = (ListItem) parent; if (!listItem.isItemParagraph(node)) return false; boolean autoLoose = isAutoLoose(); if (autoLoose && isAutoLooseOneLevelLists()) { return isTightListItem(listItem); } return !autoLoose && listItem.isParagraphInTightListItem(node) || autoLoose && listItem.isInTightList(); }
final Node paragraphParent = paragraph.getParent();
final Node paragraphParent = paragraph.getParent();