Search in sources :

Example 81 with Context

use of org.apache.wiki.api.core.Context in project jspwiki by apache.

the class MarkdownRendererTest method translate.

String translate(final Engine e, final Page p, final String src) throws Exception {
    final Context context = Wiki.context().create(e, testEngine.newHttpRequest(), p);
    final MarkdownParser tr = new MarkdownParser(context, new BufferedReader(new StringReader(src)));
    final MarkdownRenderer conv = new MarkdownRenderer(context, tr.parse());
    newPage(p.getName(), src);
    return conv.getString();
}
Also used : Context(org.apache.wiki.api.core.Context) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) MarkdownParser(org.apache.wiki.parser.markdown.MarkdownParser)

Aggregations

Context (org.apache.wiki.api.core.Context)81 Page (org.apache.wiki.api.core.Page)46 PageManager (org.apache.wiki.pages.PageManager)42 Test (org.junit.jupiter.api.Test)40 RenderingManager (org.apache.wiki.render.RenderingManager)15 PageContext (javax.servlet.jsp.PageContext)11 Engine (org.apache.wiki.api.core.Engine)9 ReferenceManager (org.apache.wiki.references.ReferenceManager)8 IOException (java.io.IOException)7 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 ServletContext (javax.servlet.ServletContext)6 ProviderException (org.apache.wiki.api.exceptions.ProviderException)6 WikiContext (org.apache.wiki.WikiContext)5 StringReader (java.io.StringReader)4 Properties (java.util.Properties)4 MockHttpServletRequest (net.sourceforge.stripes.mock.MockHttpServletRequest)4 WikiSessionTest (org.apache.wiki.WikiSessionTest)4 Attachment (org.apache.wiki.api.core.Attachment)4 SearchResult (org.apache.wiki.api.search.SearchResult)4