public YouTubeLink(final Link other) { super(other.getChars().baseSubSequence(other.getChars().getStartOffset() - 1, other.getChars().getEndOffset()), other.getChars().baseSubSequence(other.getChars().getStartOffset() - 1, other.getTextOpeningMarker().getEndOffset()), other.getText(), other.getTextClosingMarker(), other.getLinkOpeningMarker(), other.getUrl(), other.getTitleOpeningMarker(), other.getTitle(), other.getTitleClosingMarker(), other.getLinkClosingMarker() ); }
private void render(final Link node, NodeFormatterContext context, MarkdownWriter markdown) { markdown.lineIf(formatterOptions.keepExplicitLinksAtStart); if (!formatterOptions.optimizedInlineRendering || context.isTransformingText()) { markdown.append(node.getTextOpeningMarker()); if (!context.isTransformingText() || node.getFirstChildAny(HtmlInline.class) != null) { context.renderChildren(node); } else { markdown.appendTranslating(node.getText()); } markdown.append(node.getTextClosingMarker()); markdown.append(node.getLinkOpeningMarker()); markdown.append(node.getUrlOpeningMarker()); markdown.appendNonTranslating(node.getPageRef()); markdown.append(node.getAnchorMarker()); if (node.getAnchorRef().isNotNull()) { CharSequence anchorRef = context.transformAnchorRef(node.getPageRef(), node.getAnchorRef()); markdown.append(anchorRef); } markdown.append(node.getUrlClosingMarker()); if (node.getTitleOpeningMarker().isNotNull()) { markdown.append(' '); markdown.append(node.getTitleOpeningMarker()); if (node.getTitle().isNotNull()) markdown.appendTranslating(node.getTitle()); markdown.append(node.getTitleClosingMarker()); } markdown.append(node.getLinkClosingMarker()); } else { markdown.append(node.getChars()); } }
private void render(final Link node, final DocxRendererContext docx) { ResolvedLink resolvedLink = docx.resolveLink(LinkType.LINK, node.getUrl().unescape(), null, null); // we have a title part, use that Attributes attributes = resolvedLink.getNonNullAttributes(); if (node.getTitle().isNotNull()) { attributes.replaceValue(Attribute.TITLE_ATTR, node.getTitle().unescape()); } else { attributes.remove(Attribute.TITLE_ATTR); } attributes = docx.extendRenderingNodeAttributes(AttributablePart.NODE, attributes); renderURL(node.getUrl(), docx, resolvedLink.getUrl(), attributes, new ChildRenderer(docx, node)); }
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"); } }
private void render(Link node, NodeRendererContext context, HtmlWriter html) { if (context.isDoNotRenderLinks()) { context.renderChildren(node); } else { ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null); html.raw("["); context.renderChildren(node); html.raw("|").raw(resolvedLink.getUrl()).raw("]"); } }
private void render(final Link node, NodeFormatterContext context, MarkdownWriter markdown) { markdown.lineIf(formatterOptions.keepExplicitLinksAtStart); if (!formatterOptions.optimizedInlineRendering || context.isTransformingText()) { markdown.append(node.getTextOpeningMarker()); if (!context.isTransformingText() || node.getFirstChildAny(HtmlInline.class) != null) { context.renderChildren(node); } else { markdown.appendTranslating(node.getText()); } markdown.append(node.getTextClosingMarker()); markdown.append(node.getLinkOpeningMarker()); markdown.append(node.getUrlOpeningMarker()); markdown.appendNonTranslating(node.getPageRef()); markdown.append(node.getAnchorMarker()); if (node.getAnchorRef().isNotNull()) { CharSequence anchorRef = context.transformAnchorRef(node.getPageRef(), node.getAnchorRef()); markdown.append(anchorRef); } markdown.append(node.getUrlClosingMarker()); if (node.getTitleOpeningMarker().isNotNull()) { markdown.append(' '); markdown.append(node.getTitleOpeningMarker()); if (node.getTitle().isNotNull()) markdown.appendTranslating(node.getTitle()); markdown.append(node.getTitleClosingMarker()); } markdown.append(node.getLinkClosingMarker()); } else { markdown.append(node.getChars()); } }
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"); } }
private void render(Link node, NodeRendererContext context, HtmlWriter html) { if (context.isDoNotRenderLinks()) { context.renderChildren(node); } else { ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null); html.raw("["); context.renderChildren(node); html.raw("|").raw(resolvedLink.getUrl()); if (node.getTitle() != null && !node.getTitle().isEmpty()) { html.raw("|").raw(node.getTitle()); } html.raw("]"); } }
public AbstractMediaLink(String prefix, String type, final Link other) { super(other.getChars().baseSubSequence(other.getChars().getStartOffset() - prefix.length(), other.getChars().getEndOffset()), other.getChars().baseSubSequence(other.getChars().getStartOffset() - prefix.length(), other.getTextOpeningMarker().getEndOffset()), other.getText(), other.getTextClosingMarker(), other.getLinkOpeningMarker(), other.getUrl(), other.getTitleOpeningMarker(), other.getTitle(), other.getTitleClosingMarker(), other.getLinkClosingMarker() ); this.PREFIX = prefix; this.TYPE = type; verifyBasedSequence(other.getChars(), other.getChars().getStartOffset() - prefix.length()); }
private void render(Link node, NodeRendererContext context, HtmlWriter html) { if (context.isDoNotRenderLinks()) { context.renderChildren(node); } else { ResolvedLink resolvedLink = context.resolveLink(LinkType.LINK, node.getUrl().unescape(), null); html.raw("["); context.renderChildren(node); html.raw("|").raw(resolvedLink.getUrl()); if (node.getTitle() != null && !node.getTitle().isEmpty()) { html.raw("|").raw(node.getTitle()); } html.raw("]"); } }
if (isLocalFileReferenceValidation() || isRemoteReferenceValidation()) { final int lineno = computeLineNo(it); final URL url = FileSystem.convertStringToURL(it.getUrl().toString(), true); if (URISchemeType.HTTP.isURL(url) || URISchemeType.HTTPS.isURL(url) || URISchemeType.FTP.isURL(url)) { if (isRemoteReferenceValidation()) {
public YouTubeLink(final Link other) { super(other.getChars().baseSubSequence(other.getChars().getStartOffset() - 1, other.getChars().getEndOffset()), other.getChars().baseSubSequence(other.getChars().getStartOffset() - 1, other.getTextOpeningMarker().getEndOffset()), other.getText(), other.getTextClosingMarker(), other.getLinkOpeningMarker(), other.getUrl(), other.getTitleOpeningMarker(), other.getTitle(), other.getTitleClosingMarker(), other.getLinkClosingMarker() ); }