private static String renderMarkup(String content, MarkupLanguage markup,
String pattern) {
markup.setInternalLinkPattern(pattern);
StringWriter writer = new StringWriter();
DocumentBuilder builder = new HtmlDocumentBuilder(writer);
MarkupParser parser = new MarkupParser(markup, builder);
parser.parse(content, false);
return writer.toString();
}