Skip to content

Commit df93077

Browse files
Fix broken coloring
1 parent af6e01a commit df93077

File tree

1 file changed

+8
-1
lines changed
  • src/main/java/org/maxgamer/quickshop/util

1 file changed

+8
-1
lines changed

src/main/java/org/maxgamer/quickshop/util/Util.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,11 +1192,18 @@ public static String parseColours(@Nullable String text) {
11921192
if (StringUtils.isEmpty(text)) {
11931193
return "";
11941194
}
1195+
11951196
MineDownParser parser = MINEDOWN.get().parser();
11961197
parser.reset();
11971198
//A hack for saving reset character
11981199
text = text.replace("&r", "&l&r").replace("§r", "§l§r");
1199-
return toLegacyText(parser.enable(MineDownParser.Option.LEGACY_COLORS).backwardsCompatibility(true).parse(text).create());
1200+
String parseResult = toLegacyText(parser.enable(MineDownParser.Option.LEGACY_COLORS).backwardsCompatibility(true).parse(text).create());
1201+
if (parseResult.isEmpty()) {
1202+
//Pure color code hack handle
1203+
return parseColours(text + "😂").replace("😂", "");
1204+
} else {
1205+
return parseResult;
1206+
}
12001207
}
12011208

12021209
/**

0 commit comments

Comments
 (0)