aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/juick/util/MessageUtils.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java
index 5cc8bb97a..72c9bd04e 100644
--- a/src/main/java/com/juick/util/MessageUtils.java
+++ b/src/main/java/com/juick/util/MessageUtils.java
@@ -87,7 +87,7 @@ public class MessageUtils {
private final static String underlineRegex = "((?<=\\s)|(?<=\\A))_([^\\_\\n<>]+)_((?=\\s)|(?=\\Z)|(?=\\p{Punct}))";
- private final static String citateRegex = "(?:(?<=\\n)|(?<=\\A))\\> *(.*)?(\\n|(?=\\Z))";
+ private final static String citateRegex = "(?:(?<=\\n)|(?<=\\A))&gt; *(.*)?(\\n|(?=\\Z))";
public static List<Entity> getEntities(Message msg) {
@@ -144,14 +144,12 @@ public class MessageUtils {
}
public static String formatMessage(String msg) {
- // > citate
- msg = msg.replaceAll(citateRegex, "<q>$1</q>");
- msg = msg.replaceAll("</q><q>", "\n");
-
-
msg = msg.replaceAll("&", "&amp;");
msg = msg.replaceAll("<", "&lt;");
msg = msg.replaceAll(">", "&gt;");
+ // > citate
+ msg = msg.replaceAll(citateRegex, "<q>$1</q>");
+ msg = msg.replaceAll("</q><q>", "\n");
// --
// &mdash;
msg = msg.replaceAll("((?<=\\s)|(?<=\\A))\\-\\-?((?=\\s)|(?=\\Z))", "$1&mdash;$2");