diff --git a/gateway/gateway.go b/gateway/gateway.go index c8c67ca0..00844f58 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -416,6 +416,8 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM allowableTags := []string{ "p", + "i", + "b", "em", "strong", "br", @@ -440,6 +442,17 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM return "" }, }) + // Custom override for slackdown + html2md.AddRule("b", &html2md.Rule{ + Patterns: []string{"b", "strong"}, + Replacement: func(innerHTML string, attrs []string) string { + if len(attrs) > 1 { + // trailing whitespace due to Mandarin issues + return html2md.WrapInlineTag(attrs[1], "*", "* ") + } + return "" + }, + }) // Custom override of default code rule: // This converts multiline code tags to codeblocks html2md.AddRule("code", &html2md.Rule{