void (@NotNull String markupContent) { String linkText = StringUtil.escapeXmlEntities(markupContent); String linkUrl = linkText; int pos = markupContent.indexOf('<'); if (pos >= 0 && markupContent.endsWith(">")) { linkText = StringUtil.escapeXmlEntities(markupContent.substring(0, pos).trim()); linkUrl = joinLines(StringUtil.escapeXmlEntities(markupContent.substring(pos + 1, markupContent.length() - 1)), false); } myResult.append("<a href=\""); if (!linkUrl.matches("[a-z]+:.+")) { myResult.append("http://"); } myResult.append(linkUrl).append("\">").append(linkText).append("</a>"); }