From e882914b29f384d3f530865737cc7de3790e5b0e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 6 Oct 2018 23:39:10 +0300 Subject: HTML replies --- .../mitchellbosecke/pebble/extension/filters/FormatMessageFilter.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'juick-server/src/main/java/com/mitchellbosecke') 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 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("@%s", msg.getTo().getUri().toASCIIString(), msg.getTo().getName()) : String.format("@%s", msg.getTo().getName(), msg.getTo().getName()); -- cgit v1.2.3