From 3e036b370a1ccb309c6367eb91db3248ce42dd9b Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 15 Oct 2018 03:07:02 +0800 Subject: [PATCH] Fixed list parsing. --- gateway/gateway.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gateway/gateway.go b/gateway/gateway.go index 4a6bc12d..cad28d30 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -371,6 +371,9 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM url_re := regexp.MustCompile(`(((http(s)?(\:\/\/))+(www\.)?([\w\-\.\/])*(\.[a-zA-Z]{2,3}\/?))[^\s\n|]*[^.,;:\?\!\@\^\$ -])`) text = url_re.ReplaceAllString(text, "$0") + // Get rid of these wierdo bullets that Slack uses, which confuse translation + text = strings.Replace(text, "•", "-", -1) + // Make sure we use closed
tags const htmlFlags = blackfriday.HTML_USE_XHTML renderer := &renderer{Html: blackfriday.HtmlRenderer(htmlFlags, "", "").(*blackfriday.Html)} @@ -436,6 +439,9 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM "blockquote", "pre", "code", + "li", + "ul", + "ol", } stripped, _ := htmltags.Strip(text, allowableTags, false)