@Override public void render(TextBase node, NodeRendererContext context, HtmlWriter html) { if (myOptions.assignTextAttributes) { final Attributes nodeAttributes = context.extendRenderingNodeAttributes(AttributablePart.NODE, null); if (!nodeAttributes.isEmpty()) { // has attributes then we wrap it in a span html.setAttributes(nodeAttributes).withAttr().tag("span"); context.delegateRender(); html.closeTag("span"); return; } } context.delegateRender(); } }));
private void render(Image node, NodeRendererContext context, final HtmlWriter html) { if (!(context.isDoNotRenderLinks() || CoreNodeRenderer.isSuppressedLinkPrefix(node.getUrl(), context))) { final String altText = new TextCollectingVisitor().collectAndGetText(node); ResolvedLink resolvedLink = context.resolveLink(LinkType.IMAGE, node.getUrl().unescape(), null, null); final String url = resolvedLink.getUrl(); if (node.getUrlContent().isEmpty()) { Attributes attributes = resolvedLink.getNonNullAttributes(); // need to take attributes for reference definition, then overlay them with ours attributes = context.extendRenderingNodeAttributes(node, AttributablePart.NODE, attributes); if (renderVideoImage(node, url, altText, attributes, html)) { return; } } context.delegateRender(); } }
private void render(final FencedCodeBlock node, final NodeRendererContext context, HtmlWriter html) { final BasedSequence info = node.getInfoDelimitedByAny(options.blockInfoDelimiters); if (options.renderBlockMath && info.equals("math")) { html.line(); html.srcPosWithTrailingEOL(node.getChars()).attr(Attribute.CLASS_ATTR, options.blockMathClass).withAttr().tag("div").line().openPre(); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().normalizeEOL()); } html.closePre().tag("/div"); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); } else if (options.renderBlockMermaid && info.equals("mermaid")) { html.line(); html.srcPosWithTrailingEOL(node.getChars()).attr(Attribute.CLASS_ATTR, options.blockMermaidClass).withAttr().tag("div").line().openPre(); if (codeContentBlock) { context.renderChildren(node); } else { html.text(node.getContentChars().normalizeEOL()); } html.closePre().tag("/div"); html.lineIf(context.getHtmlOptions().htmlBlockCloseTagEol); } else { context.delegateRender(); } }
context.delegateRender();
@Override public void render(TextBase node, NodeRendererContext context, HtmlWriter html) { if (myOptions.assignTextAttributes) { final Attributes nodeAttributes = context.extendRenderingNodeAttributes(AttributablePart.NODE, null); if (!nodeAttributes.isEmpty()) { // has attributes then we wrap it in a span html.setAttributes(nodeAttributes).withAttr().tag("span"); context.delegateRender(); html.closeTag("span"); return; } } context.delegateRender(); } }));