diff options
author | 2018-01-18 16:27:55 +0300 | |
---|---|---|
committer | 2018-01-18 16:27:55 +0300 | |
commit | 51af5b371c55bb0a49e0c9a4ac54e4dff90002d2 (patch) | |
tree | d636714434b1554d2ce0f9a12a6e7d8b1d117e6a /juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java | |
parent | 230e5e80d9b1e3ca4535fb0dbba19246d799a737 (diff) |
tg: markdown escape
Diffstat (limited to 'juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java')
-rw-r--r-- | juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java index 0f5e0756..ebeaef42 100644 --- a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java +++ b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java @@ -41,7 +41,13 @@ public class PlainTextFormatter { String title = isReply ? "Reply by @" : "@"; String subtitle = isReply ? jmsg.getReplyQuote() : markdown ? MessageUtils.getMarkdownTags(jmsg) : jmsg.getTagsString(); sb.append(title).append(jmsg.getUser().getName()).append(":\n") - .append(subtitle).append("\n").append(StringUtils.defaultString(jmsg.getText())).append("\n"); + .append(subtitle).append("\n"); + if (markdown) { + sb.append(MessageUtils.escapeMarkdown(StringUtils.defaultString(jmsg.getText()))); + } else { + sb.append(StringUtils.defaultString(jmsg.getText())); + } + sb.append("\n"); if (StringUtils.isNotEmpty(jmsg.getAttachmentType())) { // FIXME: attachment does not serialized to xml if (jmsg.getAttachment() == null) { |