public HtmlWriter srcPosWithEOL() { return srcPosWithEOL(context.getCurrentNode().getChars()); }
private void render(final TableBlock node, final NodeRendererContext context, HtmlWriter html) { if (!options.className.isEmpty()) { html.attr("class", options.className); } html.srcPosWithEOL(node.getChars()).withAttr().tagLineIndent("table", new Runnable() { @Override public void run() { context.renderChildren(node); } }); }
private void renderListItem(final ListItem node, final NodeRendererContext context, final HtmlWriter html) { if (listOptions.isTightListItem(node)) { html.srcPosWithEOL(node.getChars()).withAttr(TIGHT_LIST_ITEM).withCondIndent().tagLine("li", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } else { html.srcPosWithEOL(node.getChars()).withAttr(LOOSE_LIST_ITEM).tagIndent("li", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } }
private void render(final DefinitionItem node, final NodeRendererContext context, final HtmlWriter html) { if (listOptions.isTightListItem(node)) { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.TIGHT_LIST_ITEM).withCondIndent().tagLine("dd", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } else { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.LOOSE_LIST_ITEM).tagIndent("dd", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } //html.srcPosWithEOL(node.getChars()).withAttr().withCondIndent().tagLine("dd", new Runnable() { // @Override // public void run() { // context.renderChildren(node); // } //}); }
private void render(final DefinitionTerm node, final NodeRendererContext context, final HtmlWriter html) { final Node childText = node.getFirstChild(); if (childText != null) { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.TIGHT_LIST_ITEM).withCondIndent().tagLine("dt", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); //html.srcPosWithEOL(childText.getChars()).withAttr().withCondIndent().tagLine("dt", new Runnable() { // @Override // public void run() { // context.renderChildren(node); // } //}); } }
private void renderLooseParagraph(final Paragraph node, final NodeRendererContext context, final HtmlWriter html) { if (context.getHtmlOptions().noPTagsUseBr) { renderTextBlockParagraphLines(node, context, html, false); html.tagVoid("br").tagVoid("br").line(); } else { html.srcPosWithEOL(node.getChars()).withAttr().tagLine("p", new Runnable() { @Override public void run() { renderTextBlockParagraphLines(node, context, html, false); } }); } }
void render(IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithEOL(node.getChars()).withAttr().tag("pre").openPre(); String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().trimTailBlankLines().normalizeEndWithEOL()); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithTrailingEOL(node.getChars()).withAttr().tag("pre").openPre(); BasedSequence info = node.getInfo(); if (info.isNotNull() && !info.isBlank()) { BasedSequence language = node.getInfoDelimitedByAny(" "); html.attr("class", context.getHtmlOptions().languageClassPrefix + language.unescape()); } else { String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().normalizeEOL()); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
public HtmlWriter srcPosWithEOL() { return srcPosWithEOL(context.getCurrentNode().getChars()); }
private void render(final TableBlock node, final NodeRendererContext context, HtmlWriter html) { if (!options.className.isEmpty()) { html.attr("class", options.className); } html.srcPosWithEOL(node.getChars()).withAttr().tagLineIndent("table", new Runnable() { @Override public void run() { context.renderChildren(node); } }); }
private void renderListItem(final ListItem node, final NodeRendererContext context, final HtmlWriter html) { if (listOptions.isTightListItem(node)) { html.srcPosWithEOL(node.getChars()).withAttr(TIGHT_LIST_ITEM).withCondIndent().tagLine("li", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } else { html.srcPosWithEOL(node.getChars()).withAttr(LOOSE_LIST_ITEM).tagIndent("li", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } }
private void render(final DefinitionItem node, final NodeRendererContext context, final HtmlWriter html) { if (listOptions.isTightListItem(node)) { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.TIGHT_LIST_ITEM).withCondIndent().tagLine("dd", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } else { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.LOOSE_LIST_ITEM).tagIndent("dd", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); } //html.srcPosWithEOL(node.getChars()).withAttr().withCondIndent().tagLine("dd", new Runnable() { // @Override // public void run() { // context.renderChildren(node); // } //}); }
private void render(final DefinitionTerm node, final NodeRendererContext context, final HtmlWriter html) { final Node childText = node.getFirstChild(); if (childText != null) { html.srcPosWithEOL(node.getChars()).withAttr(CoreNodeRenderer.TIGHT_LIST_ITEM).withCondIndent().tagLine("dt", new Runnable() { @Override public void run() { html.text(node.getMarkerSuffix().unescape()); context.renderChildren(node); } }); //html.srcPosWithEOL(childText.getChars()).withAttr().withCondIndent().tagLine("dt", new Runnable() { // @Override // public void run() { // context.renderChildren(node); // } //}); } }
private void render( IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html ) { html.line(); html.attr( "class", "source" ).tag( "div" ); html.srcPosWithEOL( node.getChars() ).withAttr().tag( "pre" ).openPre(); String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if ( !noLanguageClass.isEmpty() ) { html.attr( "class", noLanguageClass ); } //html.srcPosWithEOL(node.getContentChars()).withAttr(CoreNodeRenderer.CODE_CONTENT).tag("code"); String s = node.getContentChars().trimTailBlankLines().normalizeEndWithEOL(); while ( !s.isEmpty() && s.charAt( 0 ) == '\n' ) { html.raw( "<br/>" ); s = s.substring( 1 ); } html.text( s ); //html.tag("/code"); html.tag( "/pre" ).closePre(); html.tag( "/div" ); html.line(); }
void render(IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithEOL(node.getChars()).withAttr().tag("pre").openPre(); String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().trimTailBlankLines().normalizeEndWithEOL()); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
private void renderLooseParagraph(final Paragraph node, final NodeRendererContext context, final HtmlWriter html) { if (context.getHtmlOptions().noPTagsUseBr) { renderTextBlockParagraphLines(node, context, html, false); html.tagVoid("br").tagVoid("br").line(); } else { html.srcPosWithEOL(node.getChars()).withAttr().tagLine("p", new Runnable() { @Override public void run() { renderTextBlockParagraphLines(node, context, html, false); } }); } }
/** * Renders a {@link IndentedCodeBlock} with hardline breaks to preserve new lines in Jive * * @param node {@link IndentedCodeBlock} * @param context {@link NodeRendererContext} * @param html {@link HtmlWriter} */ private void render(IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithEOL(node.getChars()).withAttr().tag("pre").openPre(); String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (Parser.FENCED_CODE_CONTENT_BLOCK.getFrom(options)) { context.renderChildren(node); } else { renderRawWithHardBreaks(node, html); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
void render(FencedCodeBlock node, NodeRendererContext context, HtmlWriter html) { html.line(); html.srcPosWithTrailingEOL(node.getChars()).withAttr().tag("pre").openPre(); BasedSequence info = node.getInfo(); if (info.isNotNull() && !info.isBlank()) { BasedSequence language = node.getInfoDelimitedByAny(" "); html.attr("class", context.getHtmlOptions().languageClassPrefix + language.unescape()); } else { String noLanguageClass = context.getHtmlOptions().noLanguageClass.trim(); if (!noLanguageClass.isEmpty()) { html.attr("class", noLanguageClass); } } html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().normalizeEOL()); } html.tag("/code"); html.tag("/pre").closePre(); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); }
html.srcPosWithEOL(node.getContentChars()).withAttr(CODE_CONTENT).tag("code"); if (Parser.FENCED_CODE_CONTENT_BLOCK.getFrom(options)) { context.renderChildren(node);