use of org.olat.ims.qti.editor.beecom.objects.Mattext in project openolat by klemens.
the class CSVToQuestionConverter method createMattext.
private Mattext createMattext(String text) {
// text is already in a CDATA
text = text.replace("// <![CDATA[", "").replace("// ]]>", "");
// Use explicit return which create a P tag if you want a line break.
if (text.startsWith("<br />") && text.length() > 6)
text = text.substring(6);
if (text.endsWith("<br />") && text.length() > 6)
text = text.substring(0, text.length() - 6);
// Remove any conditional comments due to strange behavior in test (OLAT-4518)
Filter conditionalCommentFilter = FilterFactory.getConditionalHtmlCommentsFilter();
text = conditionalCommentFilter.filter(text);
Mattext mattext = new Mattext(text);
return mattext;
}
Aggregations