From 825e327903ab55e9bf5c230a2936f0e95257c77d Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 16 Nov 2019 01:08:20 +0100 Subject: [PATCH] Fix underscore pattern - it was wrong all along Fix test - in IntelliJ anyways --- .idea/ButtonChat.iml | 2 +- pom.xml | 15 +++++++++++++++ .../chat/components/formatter/ChatProcessing.java | 2 +- .../chat/components/formatter/ChatFormatIT.java | 4 ++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.idea/ButtonChat.iml b/.idea/ButtonChat.iml index 28193ee..43f0ec8 100644 --- a/.idea/ButtonChat.iml +++ b/.idea/ButtonChat.iml @@ -1,6 +1,6 @@ - + diff --git a/pom.xml b/pom.xml index 987b17c..d0a8e52 100644 --- a/pom.xml +++ b/pom.xml @@ -135,6 +135,21 @@ + + maven-compiler-plugin + + + default-testCompile + + testCompile + + + 1.8 + 1.8 + + + + buttondevteam diff --git a/src/main/java/buttondevteam/chat/components/formatter/ChatProcessing.java b/src/main/java/buttondevteam/chat/components/formatter/ChatProcessing.java index e94372c..e3ea8fa 100644 --- a/src/main/java/buttondevteam/chat/components/formatter/ChatProcessing.java +++ b/src/main/java/buttondevteam/chat/components/formatter/ChatProcessing.java @@ -49,7 +49,7 @@ public class ChatProcessing { private static final Pattern HASHTAG_PATTERN = Pattern.compile("#(\\w+)"); private static final Pattern URL_PATTERN = Pattern.compile("(http[\\w:/?=$\\-_.+!*'(),&]+(?:#[\\w]+)?)"); public static final Pattern ENTIRE_MESSAGE_PATTERN = Pattern.compile(".+"); - private static final Pattern UNDERLINED_PATTERN = Pattern.compile("_"); + private static final Pattern UNDERLINED_PATTERN = Pattern.compile("__"); private static final Pattern ITALIC_PATTERN = Pattern.compile("\\*"); private static final Pattern BOLD_PATTERN = Pattern.compile("\\*\\*"); private static final Pattern CODE_PATTERN = Pattern.compile("`"); diff --git a/src/test/java/buttondevteam/chat/components/formatter/ChatFormatIT.java b/src/test/java/buttondevteam/chat/components/formatter/ChatFormatIT.java index 438155d..a3bc569 100644 --- a/src/test/java/buttondevteam/chat/components/formatter/ChatFormatIT.java +++ b/src/test/java/buttondevteam/chat/components/formatter/ChatFormatIT.java @@ -38,9 +38,9 @@ public class ChatFormatIT { list.add(new ChatFormatIT(sender, "**test**", new TellrawPart("test").setBold(true).setColor(Color.White))); list.add(new ChatFormatIT(sender, "***test***", new TellrawPart("test").setBold(true).setItalic(true).setColor(Color.White))); - list.add(new ChatFormatIT(sender, "***_test_***", + list.add(new ChatFormatIT(sender, "***__test__***", new TellrawPart("test").setBold(true).setItalic(true).setUnderlined(true).setColor(Color.White))); - list.add(new ChatFormatIT(sender, "***_~~test~~_***", new TellrawPart("test").setBold(true).setItalic(true) + list.add(new ChatFormatIT(sender, "***__~~test~~__***", new TellrawPart("test").setBold(true).setItalic(true) .setUnderlined(true).setStrikethrough(true).setColor(Color.White))); list.add(new ChatFormatIT(sender, "¯\\\\\\_(ツ)\\_/¯", new TellrawPart("¯\\_(ツ)_/¯").setColor(Color.White))); list.add(new ChatFormatIT(sender, "https://google.hu/",