Search in sources :

Example 1 with CleanTextRenderer

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

the class JSPWikiMarkupParser method makeSectionTitle.

private String makeSectionTitle(String title) {
    title = title.trim();
    String outTitle;
    try {
        JSPWikiMarkupParser dtr = getCleanTranslator();
        dtr.setInputReader(new StringReader(title));
        CleanTextRenderer ctt = new CleanTextRenderer(m_context, dtr.parse());
        outTitle = ctt.getString();
    } catch (IOException e) {
        log.fatal("CleanTranslator not working", e);
        throw new InternalWikiException("CleanTranslator not working as expected, when cleaning title" + e.getMessage(), e);
    }
    return outTitle;
}
Also used : StringReader(java.io.StringReader) IOException(java.io.IOException) CleanTextRenderer(org.apache.wiki.render.CleanTextRenderer) InternalWikiException(org.apache.wiki.InternalWikiException)

Aggregations

IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 InternalWikiException (org.apache.wiki.InternalWikiException)1 CleanTextRenderer (org.apache.wiki.render.CleanTextRenderer)1