use of org.jamwiki.parser.AbstractParser in project openolat by klemens.
the class WikiArtefactDetailsController method getContent.
private static String getContent(String content) {
try {
ParserInput input = new ParserInput();
input.setWikiUser(null);
input.setAllowSectionEdit(false);
input.setDepth(2);
input.setContext("");
input.setLocale(Locale.ENGLISH);
input.setTopicName("dummy");
input.setUserIpAddress("0.0.0.0");
input.setDataHandler(new DummyDataHandler());
input.setVirtualWiki("/olat");
AbstractParser parser = new JFlexParser(input);
ParserDocument parsedDoc = parser.parseHTML(content);
String parsedContent = parsedDoc.getContent();
return FilterFactory.getHtmlTagAndDescapingFilter().filter(parsedContent);
} catch (Exception e) {
log.error("", e);
return content;
}
}
Aggregations