Skip to content

Commit

Permalink
Merge branch 'feature/9.2' into feature/11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Apr 15, 2024
2 parents e190cd1 + a231c65 commit 7717b20
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import java.util.Locale;
import java.util.function.UnaryOperator;
import java.util.regex.Pattern;

import static me.shedaniel.rei.impl.client.gui.config.options.ConfigUtils.literal;

Expand Down Expand Up @@ -106,7 +107,7 @@ public static MutableComponent highlightText(MutableComponent component, @Nullab
if (string.toLowerCase(Locale.ROOT).equals(highlight.toLowerCase(Locale.ROOT))) {
return component.withStyle(styleOperator).withStyle(ChatFormatting.YELLOW);
}
String[] parts = string.toLowerCase(Locale.ROOT).split(highlight.toLowerCase(Locale.ROOT));
String[] parts = string.toLowerCase(Locale.ROOT).split(Pattern.quote(highlight.toLowerCase(Locale.ROOT)));
if (string.toLowerCase(Locale.ROOT).endsWith(highlight.toLowerCase(Locale.ROOT))) {
// Append an empty string to the end
String[] newParts = new String[parts.length + 1];
Expand Down

0 comments on commit 7717b20

Please sign in to comment.