From 012aff8a7b81d462f44b565e11dc074aa95d9b61 Mon Sep 17 00:00:00 2001 From: Peter Joles Date: Fri, 13 Nov 2020 13:27:25 -0600 Subject: [PATCH] Add function to remove Icon Syntax for Channels that don't support it --- src/teneo-assets/ExtensionHelper.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/teneo-assets/ExtensionHelper.groovy b/src/teneo-assets/ExtensionHelper.groovy index da0251d2..ff26d1cd 100644 --- a/src/teneo-assets/ExtensionHelper.groovy +++ b/src/teneo-assets/ExtensionHelper.groovy @@ -75,6 +75,7 @@ class ExtensionHelper { return displayClickableList(['content': content, hasLongOptions: hasLongOptions, 'permanent': true, 'disabled': true] as Map) } + static String displayClickableList(def content, def channel, def hasLongOptions = false) { return displayClickableList(['content': content, hasLongOptions: hasLongOptions, 'permanent': false] as Map) } @@ -267,6 +268,10 @@ class ExtensionHelper { JsonOutput.toJson(attachment) } + static String removeIconSyntax(def content) { + return content.replaceAll("\\[\\[(.{1,30}?)\\]", ""); + } + private static String dateFormat(String isoDate) { Calendar cal = javax.xml.bind.DatatypeConverter.parseDateTime(isoDate) DateFormat df = DateFormat.getDateInstance()