aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/util/MessageUtils.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java
index 72c9bd04..dd9db293 100644
--- a/src/main/java/com/juick/util/MessageUtils.java
+++ b/src/main/java/com/juick/util/MessageUtils.java
@@ -144,12 +144,11 @@ public class MessageUtils {
}
public static String formatMessage(String msg) {
+
msg = msg.replaceAll("&", "&");
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");
@@ -207,6 +206,10 @@ public class MessageUtils {
m.appendTail(sb);
msg = sb.toString();
+ // > citate
+ msg = msg.replaceAll(citateRegex, "<q>$1</q>");
+ msg = msg.replaceAll("</q><q>", "\n");
+
msg = msg.replaceAll("\n", "<br/>\n");
return msg;
}