Skip to content

Commit 9d4c807

Browse files
Fix coloring issue for item name using escape character
1 parent 6f40a2a commit 9d4c807

File tree

1 file changed

+4
-3
lines changed
  • src/main/java/org/maxgamer/quickshop/util

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,10 +1194,11 @@ public static String parseColours(@Nullable String text) {
11941194
}
11951195
MineDownParser parser = MINEDOWN.get().parser();
11961196
parser.reset();
1197-
//MineDown does not support legacy color character, so replace it as well
1198-
text = text.replace('§', '&');
1197+
1198+
//Fix some item name using escape character, causing rgb color could not decode correctly
1199+
text = text.replace("&&x", "&x").replace("§§x", "§x");
11991200
//A hack for saving reset character
1200-
text = text.replace("&r", "&l&r");
1201+
text = text.replace("&r", "&l&r").replace("§r", "§l§r");
12011202
return toLegacyText(parser.enable(MineDownParser.Option.LEGACY_COLORS).enable(MineDownParser.Option.APPEND_COLORS_TO_EMPTY_STRING).backwardsCompatibility(true).parse(text).create());
12021203
}
12031204

0 commit comments

Comments
 (0)