Search in sources :

Example 1 with XHTMLRenderer

use of org.apache.wiki.render.XHTMLRenderer in project jspwiki by apache.

the class JSPWikiMarkupParserTest method translate_nofollow.

private String translate_nofollow(String src) throws IOException, NoRequiredPropertyException, ServletException, WikiException {
    props = TestEngine.getTestProperties();
    props.setProperty("jspwiki.translatorReader.useRelNofollow", "true");
    TestEngine testEngine2 = new TestEngine(props);
    WikiContext context = new WikiContext(testEngine2, new WikiPage(testEngine2, PAGE_NAME));
    JSPWikiMarkupParser r = new JSPWikiMarkupParser(context, new BufferedReader(new StringReader(src)));
    XHTMLRenderer conv = new XHTMLRenderer(context, r.parse());
    return conv.getString();
}
Also used : WikiContext(org.apache.wiki.WikiContext) WikiPage(org.apache.wiki.WikiPage) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) XHTMLRenderer(org.apache.wiki.render.XHTMLRenderer) TestEngine(org.apache.wiki.TestEngine)

Example 2 with XHTMLRenderer

use of org.apache.wiki.render.XHTMLRenderer in project jspwiki by apache.

the class JSPWikiMarkupParserTest method translate.

private String translate(WikiEngine e, WikiPage p, String src) throws IOException, NoRequiredPropertyException, ServletException {
    WikiContext context = new WikiContext(e, testEngine.newHttpRequest(), p);
    JSPWikiMarkupParser tr = new JSPWikiMarkupParser(context, new BufferedReader(new StringReader(src)));
    XHTMLRenderer conv = new XHTMLRenderer(context, tr.parse());
    return conv.getString();
}
Also used : WikiContext(org.apache.wiki.WikiContext) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) XHTMLRenderer(org.apache.wiki.render.XHTMLRenderer)

Example 3 with XHTMLRenderer

use of org.apache.wiki.render.XHTMLRenderer in project jspwiki by apache.

the class CounterPluginTest method translate.

private String translate(String src) throws IOException, NoRequiredPropertyException, ServletException {
    WikiContext context = new WikiContext(testEngine, new WikiPage(testEngine, "TestPage"));
    MarkupParser p = new JSPWikiMarkupParser(context, new StringReader(src));
    WikiDocument dom = p.parse();
    WikiRenderer r = new XHTMLRenderer(context, dom);
    return r.getString();
}
Also used : WikiContext(org.apache.wiki.WikiContext) JSPWikiMarkupParser(org.apache.wiki.parser.JSPWikiMarkupParser) WikiPage(org.apache.wiki.WikiPage) StringReader(java.io.StringReader) WikiRenderer(org.apache.wiki.render.WikiRenderer) XHTMLRenderer(org.apache.wiki.render.XHTMLRenderer) WikiDocument(org.apache.wiki.parser.WikiDocument) MarkupParser(org.apache.wiki.parser.MarkupParser) JSPWikiMarkupParser(org.apache.wiki.parser.JSPWikiMarkupParser)

Aggregations

StringReader (java.io.StringReader)3 WikiContext (org.apache.wiki.WikiContext)3 XHTMLRenderer (org.apache.wiki.render.XHTMLRenderer)3 BufferedReader (java.io.BufferedReader)2 WikiPage (org.apache.wiki.WikiPage)2 TestEngine (org.apache.wiki.TestEngine)1 JSPWikiMarkupParser (org.apache.wiki.parser.JSPWikiMarkupParser)1 MarkupParser (org.apache.wiki.parser.MarkupParser)1 WikiDocument (org.apache.wiki.parser.WikiDocument)1 WikiRenderer (org.apache.wiki.render.WikiRenderer)1