Skip to content

Commit

Permalink
Add an escape for exclamation marks
Browse files Browse the repository at this point in the history
&exc instead of !, to avoid trouble putting an input in, for example, an
if statement.
  • Loading branch information
mcmonkey4eva committed Oct 17, 2014
1 parent 1bc2a4e commit 0de864c
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -38,6 +38,7 @@ public EscapeTags(Denizen denizen) {
// \ = &bs
// ' = &sq
// " = &quo
// ! = &exc
//
// Also, you can input a non-breaking space via &sp
//
Expand All @@ -63,7 +64,8 @@ public static String Escape(String input) {
.replace("[", "&lb").replace("]", "&rb")
.replace(":", "&co").replace("@", "&at")
.replace(".", "&dot").replace("\\", "&bs")
.replace("'", "&sq").replace("\"", "&quo");
.replace("'", "&sq").replace("\"", "&quo")
.replace("!", "&exc");
}

/**
Expand All @@ -84,7 +86,8 @@ public static String unEscape(String input) {
.replace("&sp", String.valueOf((char)0x00A0))
.replace("&co", ":").replace("&at", "@")
.replace("&dot", ".").replace("&bs", "\\")
.replace("&quo", "\"").replace("&amp", "&");
.replace("&quo", "\"").replace("&exc", "!")
.replace("&amp", "&");
}

@EventHandler
Expand Down

0 comments on commit 0de864c

Please sign in to comment.