diff options
author | Vitaly Takmazov | 2018-10-06 23:39:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-10-06 23:39:10 +0300 |
commit | e882914b29f384d3f530865737cc7de3790e5b0e (patch) | |
tree | b87b0a1055903084882bae4c8eedfbd554687105 /juick-server/src/main/java/com/mitchellbosecke | |
parent | 0b065e1e0547885294d03df54d178587d801a15a (diff) |
HTML replies
Diffstat (limited to 'juick-server/src/main/java/com/mitchellbosecke')
-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()); |