diff options
-rw-r--r-- | src/main/java/com/juick/util/MessageUtils.java | 2 | ||||
-rw-r--r-- | src/test/java/com/juick/MessageTest.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java index 0afdfedb..9b668b7c 100644 --- a/src/main/java/com/juick/util/MessageUtils.java +++ b/src/main/java/com/juick/util/MessageUtils.java @@ -69,7 +69,7 @@ public class MessageUtils { private final static String urlWithWhitespacesRegex = urlWhiteSpacePrefix + urlRegex; - private final static Pattern regexLinks2 = Pattern.compile("((?<=\\s)|(?<=\\A))([\\[\\{]|<)((?:ht|f)tps?://(?:www\\.)?([^\\/\\s\\\"\\)\\!]+)/?(?:[^\\]\\}](?<!\\>))*)([\\]\\}]|\\>)"); + private final static Pattern regexLinks2 = Pattern.compile("((?<=\\s)|(?<=\\A))([\\[\\{]|<)((?:ht|f)tps?:\\/\\/(?:www\\.)?([^\\/\\s\\\"\\)\\!>]*)\\/?(?:[^\\]\\}](?<!>))*)([\\]\\}]|>)"); private final static String replyNumberRegex = "((?<=\\s)|(?<=\\A))\\/(\\d+)((?=\\s)|(?=\\Z)|(?=\\p{Punct}))"; diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java index 9153ea9c..b4c5f4ab 100644 --- a/src/test/java/com/juick/MessageTest.java +++ b/src/test/java/com/juick/MessageTest.java @@ -227,5 +227,8 @@ public class MessageTest { assertThat(MessageUtils.formatMessage(complexMessage), is(formattedMessage)); String multiQuoteWithCarriageReturn = "> quote line 1\r\n> quote line 2\r\nmessage"; assertThat(MessageUtils.formatMessage(multiQuoteWithCarriageReturn), is("<q>quote line 1<br/>\nquote line 2</q>message")); + MessageUtils.formatMessage("wget -t 3 -T 10 -w 5 -O - http://www.gismeteo.ru <http://www.gismeteo.ru>/city/daily/4787/ &>/dev/null\n" + + "\n" + + "if [ \"$?\" -ne \"0\" ]; then\n"); } } |