aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/formatters
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2019-02-23 18:26:05 +0300
committerGravatar Vitaly Takmazov2019-02-23 18:26:05 +0300
commit116d87c9473b8135d0466be149f070e067e8b810 (patch)
tree0ab85186dd1554c7fd3d2d39c6b606416bf1bb09 /src/main/java/com/juick/formatters
parent42af5984ef2decf3763fab51f274fd9940ec23c7 (diff)
* Add text descriptions to ActivityPub error codes
* Append ActivityPub attachments as urls * Added failing test for Hubzilla activity with Link as object
Diffstat (limited to 'src/main/java/com/juick/formatters')
-rw-r--r--src/main/java/com/juick/formatters/PlainTextFormatter.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/juick/formatters/PlainTextFormatter.java b/src/main/java/com/juick/formatters/PlainTextFormatter.java
index 378a523f7..4cb079506 100644
--- a/src/main/java/com/juick/formatters/PlainTextFormatter.java
+++ b/src/main/java/com/juick/formatters/PlainTextFormatter.java
@@ -84,6 +84,14 @@ public class PlainTextFormatter {
return "https://juick.com/m/" + jmsg.getMid();
}
+ public static String markdownUrl(String url, String description) {
+ if (StringUtils.isNotBlank(description)) {
+ return String.format("[%s](%s)", description, url);
+ } else {
+ return url;
+ }
+ }
+
public static String formatPostNumber(com.juick.Message jmsg) {
if (jmsg.getRid() > 0) {
return String.format("%d/%d", jmsg.getMid(), jmsg.getRid());