Advanced settings search - proper hilighting of unicode, case insensitive

This commit is contained in:
Jindra Petřík
2022-11-14 08:43:41 +01:00
parent 4b29f744f9
commit 244e882bd5

View File

@@ -417,7 +417,7 @@ public class AdvancedSettingsDialog extends AppDialog {
}
String locNameHtml = locName;
if (!filter.trim().equals("")) {
locNameHtml = locNameHtml.replaceAll("(?i)" + Pattern.quote(filter), "{bold}$0{/bold}");
locNameHtml = Pattern.compile(Pattern.quote(filter), Pattern.UNICODE_CASE + Pattern.CASE_INSENSITIVE).matcher(locNameHtml).replaceAll("{bold}$0{/bold}");
}
locNameHtml = "<html>" + locNameHtml.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")+ "</html>";
locNameHtml = locNameHtml.replace("{bold}", "<span style=\"background-color:"+hilightBackgroundColorHex+"; color: " + hilightForegroundColorHex + "\">").replace("{/bold}", "</span>");