Commit c3c41ad3 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Escape LF with <br> when parsing HTML text.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6032 b35dd754-fafc-0310-a699-88a17e54d16e
parent 86c9b8eb
......@@ -231,7 +231,7 @@ public class StringUtils {
/**
* This method takes a string which may contain HTML tags (ie, &lt;b&gt;,
* &lt;table&gt;, etc) and converts the '&lt'' and '&gt;' characters to
* their HTML escape sequences.
* their HTML escape sequences. It will also replace LF with &lt;br&gt;.
*
* @param in the text to be converted.
* @return the input string with the characters '&lt;' and '&gt;' replaced
......@@ -265,6 +265,13 @@ public class StringUtils {
last = i + 1;
out.append(GT_ENCODE);
}
else if (ch == '\n') {
if (i > last) {
out.append(input, last, i - last);
}
last = i + 1;
out.append("<br>");
}
}
if (last == 0) {
return in;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment