support more formatting
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m37s

This commit is contained in:
Lee 2024-04-16 20:53:27 +01:00
parent bedde3b0eb
commit 924e045a18

View File

@ -75,12 +75,21 @@ public final class ColorUtils {
nextIsColor = true;
continue;
}
if (nextIsColor) { // Map the current color to its hex code
if (nextIsColor && !String.valueOf(character).equals("|")) { // Map the current color to its hex code
String color = COLOR_MAP.getOrDefault(Character.toLowerCase(character), "");
builder.append("<span style=\"color:").append(color);
if (character == 'l') { // Make the char bold
builder.append(";font-weight:bold");
}
if (character == 'n') { // Make the char underlined
builder.append(";text-decoration:underline");
}
if (character == 'o') { // Make the char italic
builder.append(";font-style:italic");
}
if (character == 'm') { // Make the char strikethrough
builder.append(";text-decoration:line-through");
}
builder.append("\">");
nextIsColor = false;
continue;