/** * Repairs the given HTML input by adding potentially missing closing tags.<p> * * @param input the HTML input * * @return the repaired HTML or an empty string in case of errors */ public static String repairHtml(String input) { CmsHtmlConverter converter = new CmsHtmlConverter(); String result = converter.convertToStringSilent(input); return result == null ? "" : result; }
/** * @see org.opencms.workplace.editors.CmsSimplePageEditor#prepareContent(boolean) */ protected String prepareContent(boolean save) { if (save) { String conversionSetting = CmsHtmlConverter.getConversionSettings(getCms(), m_file); if (CmsStringUtil.isEmptyOrWhitespaceOnly(conversionSetting)) { // by default we want to pretty-print and Xhtml format when saving the content in FCKeditor String content = getParamContent(); CmsHtmlConverter converter = new CmsHtmlConverter(getEncoding(), CmsHtmlConverter.PARAM_XHTML); content = converter.convertToStringSilent(content); setParamContent(content); } } // do further processing with super class return super.prepareContent(true); } }
if (CmsHtmlConverter.isConversionEnabled(contentConversion)) { CmsHtmlConverter converter = new CmsHtmlConverter(encoding, contentConversion); finalValue = converter.convertToStringSilent(finalValue); finalValue = fixNullCharacters(finalValue);
if (CmsHtmlConverter.isConversionEnabled(contentConversion)) { CmsHtmlConverter converter = new CmsHtmlConverter(encoding, contentConversion); finalValue = converter.convertToStringSilent(finalValue);