/** * Generate the HTML for an interwiki anchor link. * * @param wikiLink The WikiLink object containing all relevant information about the link being * generated. * @return The HTML anchor tag for the interwiki link. */ public static String interWiki(WikiLink wikiLink) { // remove namespace from link destination String destination = wikiLink.getDestination(); String namespace = wikiLink.getNamespace(); destination = destination.substring( wikiLink.getNamespace().length() + NamespaceHandler.NAMESPACE_SEPARATOR.length()); String url = InterWikiHandler.formatInterWiki(namespace, destination); String text = (!StringUtils.isBlank(wikiLink.getText())) ? wikiLink.getText() : wikiLink.getDestination(); return "<a class=\"interwiki\" rel=\"nofollow\" title=\"" + text + "\" href=\"" + url + "\">" + text + "</a>"; }