@Override protected void emitContent(String content, boolean extended) throws IOException { if (content.matches("!.*?!")) { //$NON-NLS-1$ ConfluenceDocumentBuilder.this.emitContent(content); } else { ConfluenceDocumentBuilder.this.emitContent('"'); ConfluenceDocumentBuilder.this.emitContent(content); ConfluenceDocumentBuilder.this.emitContent('"'); } ConfluenceDocumentBuilder.this.emitContent(':'); ConfluenceDocumentBuilder.this.emitContent(attributes.getHref()); } }
@Override public void beginSpan(SpanType type, Attributes attributes) { if (type == SpanType.LINK) { if (attributes instanceof LinkAttributes) { LinkAttributes linkAttributes = (LinkAttributes) attributes; if (linkAttributes.getHref() != null && !linkAttributes.getHref().startsWith("#")) { //$NON-NLS-1$ IRegion region = createRegion(); links.add(new HyperlinkDescriptor(linkAttributes.getHref(), region)); } } } } });
@Override public void beginSpan(SpanType type, Attributes attributes) { super.beginSpan(type, attributes); if (type == SpanType.LINK) { if (attributes instanceof LinkAttributes) { LinkAttributes linkAttributes = (LinkAttributes) attributes; processLink(getLocator(), linkAttributes.getHref()); } } }
@Override public void beginSpan(SpanType type, Attributes attributes) { String elementName = spanTypeToElementName.get(type); if (elementName == null) { throw new IllegalStateException(type.name()); } writer.writeStartElement(htmlNsUri, elementName); if (type == SpanType.LINK && attributes instanceof LinkAttributes) { String href = ((LinkAttributes) attributes).getHref(); emitAnchorHref(href); applyLinkAttributes(attributes, href); } else { applyAttributes(attributes); } }
case LINK: { LinkAttributes linkAttributes = (LinkAttributes) attributes; String href = linkAttributes.getHref(); if (href.startsWith("#")) { //$NON-NLS-1$ writer.writeStartElement("link"); //$NON-NLS-1$
LinkAttributes linkAttributes = (LinkAttributes) attributes; writer.writeStartElement("xref"); //$NON-NLS-1$ writer.writeAttribute("href", computeDitaXref(linkAttributes.getHref())); //$NON-NLS-1$