Skip to content

Commit

Permalink
#756 Whitespace are encoded in &#160 instead of  
Browse files Browse the repository at this point in the history
Also added a function to decode these whitespaces

Change-Id: Id02ad44c0fa5bff88eb4f7b1d88325520109f2d2
Signed-off-by: Erwann Traisnel <[email protected]>
  • Loading branch information
etraisnel2 authored and pdulth committed Mar 22, 2023
1 parent 6b0f7c5 commit de50630
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,16 @@ public static String encodeWhiteSpaces(String input) {
return replaced;
}

public static String decodeWhiteSpaces(String input) {
String replaced = input.replaceAll("&nbsp;", " ");
replaced = input.replaceAll("&#160;", " ");
return replaced;
}

private static String replaceAllWhiteSpacesButLast(String input) {
String result = "";
for (int i = 0; i < input.length() - 1; i++) {
result += "&nbsp;";
result += "&#160;";
}
result += " ";
return result;
Expand Down

0 comments on commit de50630

Please sign in to comment.