support multi-line code blocks.

This commit is contained in:
Dan Walmsley
2021-12-07 02:38:50 +00:00
parent ccced05391
commit d3074ae874

View File

@@ -10,6 +10,7 @@ import (
"github.com/42wim/matterbridge/bridge/config"
"github.com/42wim/matterbridge/bridge/helper"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"fmt"
)
func (b *Btelegram) handleUpdate(rmsg *config.Message, message, posted, edited *tgbotapi.Message) *tgbotapi.Message {
@@ -455,5 +456,9 @@ func (b *Btelegram) handleEntities(rmsg *config.Message, message *tgbotapi.Messa
if e.Type == "code" {
rmsg.Text = "`" + rmsg.Text + "`"
}
if e.Type == "pre" {
rmsg.Text = "```\n" + rmsg.Text + "\n```"
}
}
}