diff options
author | Vitaly Takmazov | 2019-01-22 20:41:12 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-01-22 20:41:12 +0300 |
commit | dd7b6d46a7d0efd7198415b6bcc3e86e1d921821 (patch) | |
tree | 8904306b044d8154a1bfa2c6ae62fa1d5baf522e | |
parent | 7424474bb1c5e72a684544bb17498578e12f084e (diff) |
fix quote escaping
-rw-r--r-- | src/main/java/com/juick/util/MessageUtils.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java index 84c29807..5cc8bb97 100644 --- a/src/main/java/com/juick/util/MessageUtils.java +++ b/src/main/java/com/juick/util/MessageUtils.java @@ -144,6 +144,11 @@ 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("&", "&"); msg = msg.replaceAll("<", "<"); msg = msg.replaceAll(">", ">"); @@ -204,10 +209,6 @@ 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; } |