summaryrefslogtreecommitdiffstats
path: root/bridge/helper
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-03-03 00:29:29 +0100
committerGitHub <noreply@github.com>2019-03-03 00:29:29 +0100
commite955a056e2aa4a07c6375315113886b2ee86138c (patch)
tree572de7d6bc399a169b09f6fa6bc78895ae6557ee /bridge/helper
parent723f8c5fd5392e5d8cceefe3a85b44004e5fcfa1 (diff)
downloadmatterbridge-msglm-e955a056e2aa4a07c6375315113886b2ee86138c.tar.gz
matterbridge-msglm-e955a056e2aa4a07c6375315113886b2ee86138c.tar.bz2
matterbridge-msglm-e955a056e2aa4a07c6375315113886b2ee86138c.zip
Trim <p> and </p> tags (matrix). Closes #686 (#753)
Diffstat (limited to 'bridge/helper')
-rw-r--r--bridge/helper/helper.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/bridge/helper/helper.go b/bridge/helper/helper.go
index c336fd13..dceb4848 100644
--- a/bridge/helper/helper.go
+++ b/bridge/helper/helper.go
@@ -178,7 +178,10 @@ func ClipMessage(text string, length int) string {
func ParseMarkdown(input string) string {
md := markdown.New(markdown.XHTMLOutput(true), markdown.Breaks(true))
- return (md.RenderToString([]byte(input)))
+ res := md.RenderToString([]byte(input))
+ res = strings.TrimPrefix(res, "<p>")
+ res = strings.TrimSuffix(res, "</p>\n")
+ return res
}
// ConvertWebPToPNG convert input data (which should be WebP format to PNG format)