private void renderChildrenSourceLineWrapped( final Node node, final BasedSequence nodeChildText, final NodeRendererContext context, final HtmlWriter html ) { // if have SOFT BREAK or HARD BREAK as child then we open our own span if (context.getHtmlOptions().sourcePositionParagraphLines && nodeChildText.indexOfAny(EOL_CHARS) >= 0) { if (myNextLine > 0) { myNextLine--; } outputSourceLineSpan(node, node, node, html); context.renderChildren(node); html.tag("/span"); } else { context.renderChildren(node); } }
public void renderTextBlockParagraphLines(final Paragraph node, final NodeRendererContext context, final HtmlWriter html, final boolean wrapTextInSpan) { if (context.getHtmlOptions().sourcePositionParagraphLines) { if (node.hasChildren()) { LineCollectingVisitor breakCollectingVisitor = new LineCollectingVisitor(); myLines = breakCollectingVisitor.collectAndGetRanges(node); myEOLs = breakCollectingVisitor.getEOLs(); myNextLine = 0; outputSourceLineSpan(node, node.getFirstChild(), node, html); context.renderChildren(node); html.tag("/span"); return; } } if (wrapTextInSpan) { html.withAttr().tag("span", false, false, new Runnable() { @Override public void run() { context.renderChildren(node); } }); } else { context.renderChildren(node); } }
private void renderChildrenSourceLineWrapped( final Node node, final BasedSequence nodeChildText, final NodeRendererContext context, final HtmlWriter html ) { // if have SOFT BREAK or HARD BREAK as child then we open our own span if (context.getHtmlOptions().sourcePositionParagraphLines && nodeChildText.indexOfAny(EOL_CHARS) >= 0) { if (myNextLine > 0) { myNextLine--; } outputSourceLineSpan(node, node, node, html); context.renderChildren(node); html.tag("/span"); } else { context.renderChildren(node); } }
public void renderTextBlockParagraphLines(final Paragraph node, final NodeRendererContext context, final HtmlWriter html, final boolean wrapTextInSpan) { if (context.getHtmlOptions().sourcePositionParagraphLines) { if (node.hasChildren()) { LineCollectingVisitor breakCollectingVisitor = new LineCollectingVisitor(); myLines = breakCollectingVisitor.collectAndGetRanges(node); myEOLs = breakCollectingVisitor.getEOLs(); myNextLine = 0; outputSourceLineSpan(node, node.getFirstChild(), node, html); context.renderChildren(node); html.tag("/span"); return; } } if (wrapTextInSpan) { html.withAttr().tag("span", false, false, new Runnable() { @Override public void run() { context.renderChildren(node); } }); } else { context.renderChildren(node); } }