diff options
Diffstat (limited to 'juick-server/src/main/java/com/mitchellbosecke/pebble')
-rw-r--r-- | juick-server/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java b/juick-server/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java index 93f9fccb..f347c1c3 100644 --- a/juick-server/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java +++ b/juick-server/src/main/java/com/mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java @@ -38,6 +38,9 @@ public class FormatMessageFilter implements Filter { public Object apply(Object input, Map<String, Object> args, PebbleTemplate self, EvaluationContext context, int lineNumber) { if (input instanceof Message) { Message msg = (Message) input; + if (msg.isHtml()) { + return new SafeString(msg.getText()); + } boolean isCode = msg.getTags().stream().anyMatch(t -> t.getName().equals("code")); String toUserString = msg.getTo().getUid() == 0 ? String.format("<a href=\"%s\" data-user-uri=\"1\">@%s</a>", msg.getTo().getUri().toASCIIString(), msg.getTo().getName()) : String.format("<a href=\"https://juick.com/%s/\">@%s</a>", msg.getTo().getName(), msg.getTo().getName()); |