From 1ec08dec729c799cccb6290e6afb507ba2740285 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 25 Aug 2011 14:40:01 +0000 Subject: [PATCH] #7478 Util.escapeHtml incorrectly converts newline to
and space to " " in IE6-IE8 svn changeset:20662/svn branch:6.7 --- src/com/vaadin/terminal/gwt/client/Util.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 7edad795fe..9d2f1d3968 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -248,7 +248,14 @@ public class Util { */ public static String escapeHTML(String html) { DOM.setInnerText(escapeHtmlHelper, html); - return DOM.getInnerHTML(escapeHtmlHelper); + String escapedText = DOM.getInnerHTML(escapeHtmlHelper); + if (BrowserInfo.get().isIE() && BrowserInfo.get().getIEVersion() < 9) { + // #7478 IE6-IE8 "incorrectly" returns "
" for newlines set using + // setInnerText. The same for " " which is converted to " " + escapedText = escapedText.replaceAll("<(BR|br)>", "\n"); + escapedText = escapedText.replaceAll(" ", " "); + } + return escapedText; } /** -- 2.39.5