diff options
author | Vitaly Takmazov | 2022-12-23 03:50:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-23 03:50:55 +0300 |
commit | 73f010403bffb4ed4662c8fcc3834239692bba1c (patch) | |
tree | de14244265c37ede89319a4be9feb8aa28d71d1d | |
parent | 610c46c8e1f44b7e4196489bd6e3abea8dfc744e (diff) |
Format mentions to make Mastodon happy
-rw-r--r-- | src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java b/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java index 0f4ba034..009cc83a 100644 --- a/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java +++ b/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java @@ -45,7 +45,7 @@ public class FormatMessageFilter implements Filter { if (MessageUtils.isPM(msg)) { return new SafeString(formattedMessage); } else { - String toUserString = msg.getTo().getUid() == 0 ? String.format("<a class=\"mention\" href=\"%s\" data-user-uri=\"1\">@%s</a>", + String toUserString = msg.getTo().getUid() == 0 ? String.format("<span class=\"h-card\"><a class=\"mention u-url\" href=\"%s\" data-user-uri=\"1\">@%s</a></span>", msg.getTo().getUri().toASCIIString(), msg.getTo().getName()) : String.format("<span class=\"h-card\"><a class=\"u-url\" href=\"https://juick.com/%s/\">@%s</a></span>", msg.getTo().getName(), msg.getTo().getName()); String formatString = MessageUtils.replyStartsWithQuote(msg) ? "%s,\n%s" : "%s, %s"; String msgTxt = msg.getRid() > 0 ? String.format(formatString, toUserString, formattedMessage) |