fix #1885: filter letter color code (#1890)

This commit is contained in:
Glavo 2022-12-02 17:28:25 +08:00 committed by GitHub
parent a6231ac593
commit 1ec9e41459
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,7 +216,10 @@ public final class StringUtils {
}
public static String parseColorEscapes(String original) {
return original.replaceAll("\u00A7\\d", "");
if (original.indexOf('\u00A7') < 0)
return original;
return original.replaceAll("\u00A7[0-9a-gklmnor]", "");
}
public static String parseEscapeSequence(String str) {