diff options
author | 2018-01-17 14:38:32 +0300 | |
---|---|---|
committer | 2018-01-17 14:38:32 +0300 | |
commit | be8d139d8ea58396107cf1a2b12ad16ac8bda6d6 (patch) | |
tree | b73c449f4a87b16541bc46bd697b1cf632de2c25 /juick-core/src/main/java/com/juick/formatters | |
parent | dadfbdb7379ebe9623643902a6a0aa78ca528228 (diff) |
api: markdown tags for telegram
Diffstat (limited to 'juick-core/src/main/java/com/juick/formatters')
-rw-r--r-- | juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java | 6 |
1 files changed, 5 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 459384fb..0f5e0756 100644 --- a/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java +++ b/juick-core/src/main/java/com/juick/formatters/PlainTextFormatter.java @@ -32,10 +32,14 @@ public class PlainTextFormatter { static PrettyTime pt = new PrettyTime(new Locale("ru")); public static String formatPost(Message jmsg) { + return formatPost(jmsg, false); + } + + public static String formatPost(Message jmsg, boolean markdown) { StringBuilder sb = new StringBuilder(); boolean isReply = jmsg.getRid() > 0; String title = isReply ? "Reply by @" : "@"; - String subtitle = isReply ? jmsg.getReplyQuote() : jmsg.getTagsString(); + 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"); if (StringUtils.isNotEmpty(jmsg.getAttachmentType())) { |