Replace ' with ' in encodeXml(), and remove some empty lines.
This commit is contained in:
parent
5d130c9ecb
commit
f2904d1f29
1 changed files with 1 additions and 15 deletions
|
@ -884,22 +884,18 @@ public final class HtmlEncoder {
|
|||
switch (c) {
|
||||
case '<':
|
||||
ret.append("<");
|
||||
|
||||
break;
|
||||
|
||||
case '>':
|
||||
ret.append(">");
|
||||
|
||||
break;
|
||||
|
||||
case '&':
|
||||
ret.append("&");
|
||||
|
||||
break;
|
||||
|
||||
case '"':
|
||||
ret.append(""");
|
||||
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
|
@ -907,11 +903,9 @@ public final class HtmlEncoder {
|
|||
ret.append("<br />");
|
||||
}
|
||||
ret.append('\n');
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
// ret.append (c);
|
||||
if (c < 128) {
|
||||
ret.append(c);
|
||||
|
@ -939,15 +933,12 @@ public final class HtmlEncoder {
|
|||
}
|
||||
|
||||
int l = str.length();
|
||||
|
||||
if (l == 0) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuffer ret = new StringBuffer(Math.round(l * 1.2f));
|
||||
|
||||
encodeXml(str, ret);
|
||||
|
||||
return ret.toString();
|
||||
}
|
||||
|
||||
|
@ -970,27 +961,22 @@ public final class HtmlEncoder {
|
|||
switch (c) {
|
||||
case '<':
|
||||
ret.append("<");
|
||||
|
||||
break;
|
||||
|
||||
case '>':
|
||||
ret.append(">");
|
||||
|
||||
break;
|
||||
|
||||
case '&':
|
||||
ret.append("&");
|
||||
|
||||
break;
|
||||
|
||||
case '"':
|
||||
ret.append(""");
|
||||
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
ret.append("'");
|
||||
|
||||
ret.append("'");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue