Search in sources :

Example 1 with MarkdownRenderer

use of org.apache.wiki.render.markdown.MarkdownRenderer in project jspwiki by apache.

the class MarkdownRendererTest method translate.

String translate(final WikiEngine e, final WikiPage p, final String src) throws Exception {
    WikiContext context = new WikiContext(e, testEngine.newHttpRequest(), p);
    MarkdownParser tr = new MarkdownParser(context, new BufferedReader(new StringReader(src)));
    MarkdownRenderer conv = new MarkdownRenderer(context, tr.parse());
    newPage(p.getName(), src);
    return conv.getString();
}
Also used : WikiContext(org.apache.wiki.WikiContext) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) MarkdownParser(org.apache.wiki.parser.markdown.MarkdownParser) MarkdownRenderer(org.apache.wiki.render.markdown.MarkdownRenderer)

Aggregations

BufferedReader (java.io.BufferedReader)1 StringReader (java.io.StringReader)1 WikiContext (org.apache.wiki.WikiContext)1 MarkdownParser (org.apache.wiki.parser.markdown.MarkdownParser)1 MarkdownRenderer (org.apache.wiki.render.markdown.MarkdownRenderer)1