/** * Gets the diff HTML based on the selected display options.<p> * * @return the diff HTML to display * * @throws Exception if something goes wrong */ public String getDiffHtml() throws Exception { CmsDiffViewMode mode = "all".equals(m_diffMode) ? CmsDiffViewMode.ALL : CmsDiffViewMode.DIFF_ONLY; String text1 = m_text1; String text2 = m_text2; if ("text".equals(m_textMode)) { text1 = CmsHtml2TextConverter.html2text(text1, "UTF-8"); text2 = CmsHtml2TextConverter.html2text(text2, "UTF-8"); } CmsHtmlDifferenceConfiguration conf = new CmsHtmlDifferenceConfiguration( mode == CmsDiffViewMode.ALL ? -1 : 2, A_CmsUI.get().getLocale()); String diff = Diff.diffAsHtml(text1, text2, conf); String html = null; if (CmsStringUtil.isNotEmpty(diff)) { html = diff; } else { html = wrapLinesWithUnchangedStyle( CmsStringUtil.substitute(CmsStringUtil.escapeHtml(m_text1), "<br/>", "")); } return html; }
out.println("<table cellspacing='0' cellpadding='0' class='xmlTable'>\n<tr><td><pre style='overflow:auto'>"); try { CmsHtmlDifferenceConfiguration conf = new CmsHtmlDifferenceConfiguration( getMode() == CmsDiffViewMode.ALL ? -1 : getLinesBeforeSkip(), getLocale());
out.println("<table cellspacing='0' cellpadding='0' class='xmlTable'>\n<tr><td><pre style='overflow:auto'>"); try { CmsHtmlDifferenceConfiguration conf = new CmsHtmlDifferenceConfiguration( getMode() == CmsDiffViewMode.ALL ? -1 : getLinesBeforeSkip(), getLocale());
out.println("<table cellspacing='0' cellpadding='0' class='xmlTable'>\n<tr><td><pre style='overflow:auto'>"); try { CmsHtmlDifferenceConfiguration conf = new CmsHtmlDifferenceConfiguration( getMode() == CmsDiffViewMode.ALL ? -1 : getLinesBeforeSkip(), getLocale());
out.println("<table cellspacing='0' cellpadding='0' class='xmlTable'>\n<tr><td><pre style='overflow:auto'>"); try { CmsHtmlDifferenceConfiguration conf = new CmsHtmlDifferenceConfiguration( getMode() == CmsDiffViewMode.ALL ? -1 : getLinesBeforeSkip(), getLocale());