void render(Link node, NodeRendererContext context, HtmlWriter html) { if (context.isDoNotRenderLinks() || isSuppressedLinkPrefix(node.getUrl(), context)) { context.renderChildren(node); } else { ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null, null); html.attr("href", resolvedLink.getUrl()); // we have a title part, use that if (node.getTitle().isNotNull()) { resolvedLink.getNonNullAttributes().replaceValue(Attribute.TITLE_ATTR, node.getTitle().unescape()); } else { resolvedLink.getNonNullAttributes().remove(Attribute.TITLE_ATTR); } html.attr(resolvedLink.getAttributes()); html.srcPos(node.getChars()).withAttr(resolvedLink).tag("a"); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.tag("/a"); } }
} else { html.text(node.getChars().prefixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.text(node.getChars().suffixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.tag("/a");
void render(Link node, NodeRendererContext context, HtmlWriter html) { if (context.isDoNotRenderLinks() || isSuppressedLinkPrefix(node.getUrl(), context)) { context.renderChildren(node); } else { ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null, null); html.attr("href", resolvedLink.getUrl()); // we have a title part, use that if (node.getTitle().isNotNull()) { resolvedLink.getNonNullAttributes().replaceValue(Attribute.TITLE_ATTR, node.getTitle().unescape()); } else { resolvedLink.getNonNullAttributes().remove(Attribute.TITLE_ATTR); } html.attr(resolvedLink.getAttributes()); html.srcPos(node.getChars()).withAttr(resolvedLink).tag("a"); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.tag("/a"); } }
} else { html.text(node.getChars().prefixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.text(node.getChars().suffixOf(node.getChildChars()).unescape()); renderChildrenSourceLineWrapped(node, node.getText(), context, html); html.tag("/a");