@Test public void testResolveMarkdownForText() { String result = sut.resolveMarkdownForText("Pre-stuff [Link1](#dest1) Middle [Link2](http: assertEquals("Pre-stuff Link1 (" + BASE_URL + "#dest1) Middle Link2 (http: }
public String resolveMarkdownForText(final String input) { Matcher matcher = MARKDOWN_LINK_PATTERN.matcher(input); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, ""); String text = matcher.group(1); String url = matcher.group(2); if (url.charAt(0) == '#') { url = baseUrl + url; } sb.append(text).append(" (").append(url).append(")"); } if (sb.length() > 0) { matcher.appendTail(sb); return sb.toString(); } else { return input; } }
NotificationMessageBuilderHelper { public String resolveMarkdownForText(final String input) { Matcher matcher = MARKDOWN_LINK_PATTERN.matcher(input); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, ""); String text = matcher.group(1); String url = matcher.group(2); if (url.charAt(0) == '#') { url = baseUrl + url; } sb.append(text).append(" (").append(url).append(")"); } if (sb.length() > 0) { matcher.appendTail(sb); return sb.toString(); } else { return input; } } }
NotificationMessageBuilderHelper { public String resolveMarkdownForText(final String input) { Matcher matcher = MARKDOWN_LINK_PATTERN.matcher(input); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, ""); String text = matcher.group(1); String url = matcher.group(2); if (url.charAt(0) == '#') { url = baseUrl + url; } sb.append(text).append(" (").append(url).append(")"); } if (sb.length() > 0) { matcher.appendTail(sb); return sb.toString(); } else { return input; } } NotificationMessageBuilderHelper(final String inBaseUrl); }
NotificationMessageBuilderHelper { public String resolveMarkdownForText(final String input) { Matcher matcher = MARKDOWN_LINK_PATTERN.matcher(input); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, ""); String text = matcher.group(1); String url = matcher.group(2); if (url.charAt(0) == '#') { url = baseUrl + url; } sb.append(text).append(" (").append(url).append(")"); } if (sb.length() > 0) { matcher.appendTail(sb); return sb.toString(); } else { return input; } } NotificationMessageBuilderHelper(final String inBaseUrl); String resolveActivityBody(final ActivityDTO activity, final Context context); String cleanWhitespace(final String input); String resolveMarkdownForText(final String input); String resolveMarkdownForHtml(final String input); }
NotificationMessageBuilderHelper { public String resolveMarkdownForText(final String input) { Matcher matcher = MARKDOWN_LINK_PATTERN.matcher(input); StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, ""); String text = matcher.group(1); String url = matcher.group(2); if (url.charAt(0) == '#') { url = baseUrl + url; } sb.append(text).append(" (").append(url).append(")"); } if (sb.length() > 0) { matcher.appendTail(sb); return sb.toString(); } else { return input; } } NotificationMessageBuilderHelper(final String inBaseUrl); String resolveActivityBody(final ActivityDTO activity, final Context context); String cleanWhitespace(final String input); String resolveMarkdownForText(final String input); String resolveMarkdownForHtml(final String input);  }