mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 18:46:15 +00:00
fix: more strict regex
This commit is contained in:
parent
a085756c7d
commit
79589edc44
1 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ import java.nio.charset.StandardCharsets;
|
|||
import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CustomChat {
|
||||
private static final GsonComponentSerializer GSON = GsonComponentSerializer.gson();
|
||||
|
|
@ -34,6 +35,9 @@ public class CustomChat {
|
|||
.toBuilder()
|
||||
|
||||
.extractUrls(
|
||||
Pattern
|
||||
.compile("((https?://(ww(w|\\d)\\.)?|ww(w|\\d))[-a-zA-Z0-9@:%._+~#=]{1,256}"
|
||||
+ "\\.[a-zA-Z0-9]{1,63}\\b([-a-zA-Z0-9@:%_+.~#?&/=]*))"),
|
||||
Style.style(
|
||||
NamedTextColor.BLUE,
|
||||
TextDecoration.UNDERLINED,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue