Skip to content

Commit

Permalink
add all characters 13 and under
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Pullara committed Sep 24, 2012
1 parent 8f7f3a0 commit 83047ca
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

/**
* Escapes user data that you wish to include in HTML pages.
*
* Set
* -Dmustache.escapeescaped if you want to reescape valid escaped HTML values
*/
public class HtmlEscaper {
public static void escape(String value, Writer writer, boolean escapeEscaped) {
Expand Down Expand Up @@ -43,9 +40,13 @@ public static void escape(String value, Writer writer, boolean escapeEscaped) {
case '\'':
position = append(value, writer, position, i, "'");
break;
case '\n':
position = append(value, writer, position, i, "
");
break;
}
if (c <= 13) {
writer.append(value, position, i);
writer.append("&#");
writer.append(String.valueOf((int)c));
writer.append(";");
position = i + 1;
}
}
writer.append(value, position, length);
Expand Down

0 comments on commit 83047ca

Please sign in to comment.