aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/juick/util/MessageUtils.java2
-rw-r--r--src/test/java/com/juick/MessageTest.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java
index fa94e978..0afdfedb 100644
--- a/src/main/java/com/juick/util/MessageUtils.java
+++ b/src/main/java/com/juick/util/MessageUtils.java
@@ -93,7 +93,7 @@ public class MessageUtils {
private final static String underlineRegex = "((?<=\\s)|(?<=\\A))_([^\\_\\n<>]+)_((?=\\s)|(?=\\Z)|(?=\\p{Punct}))";
- private final static String citateRegex = "(?:(?<=\\n)|(?<=\\A))(?:&gt;|>) *(.*)?(\\n|(?=\\Z))";
+ private final static String citateRegex = "(?:(?<=\\n)|(?<=\\A))(?:&gt;|>) *(.*)?(\\r?\\n|(?=\\Z))";
public static List<Entity> getEntities(Message msg) {
diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java
index eabeeb0f..9153ea9c 100644
--- a/src/test/java/com/juick/MessageTest.java
+++ b/src/test/java/com/juick/MessageTest.java
@@ -225,7 +225,7 @@ public class MessageTest {
"Вкратце: малолетний долбоёб ездил по встрече, по тротуарам, парковался где хотел и всё это выкладывал в сеть, мол, хули вы мне сделоете. Сделали. Ибо нехуй.";
assertThat(MessageUtils.formatMessage(complexMessage), is(formattedMessage));
- String multiQuote = "> quote line 1\n> quote line 2\nmessage";
- assertThat(MessageUtils.formatMessage(multiQuote), is("<q>quote line 1<br/>\nquote line 2</q>message"));
+ 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"));
}
}