}
// post sends event to the chat. A reply goes as rich messages of its Markdown,
-// split with telegramSplitRich. Every other event goes as plain text, split
-// with telegramSplitMessage.
+// with each < outside code escaped by telegramEscapeTags and then split with
+// telegramSplitRich, so that the length limit counts the escaped text. Every
+// other event goes as plain text, split with telegramSplitMessage.
func (b *TelegramBot) post(ctx context.Context, event Event) {
if event.Kind != "reply" {
for _, text := range telegramSplitMessage(telegramText(event), telegramMessageUnits) {
return
}
- for _, markdown := range telegramSplitRich(event.Text, telegramRichBytes) {
+ for _, markdown := range telegramSplitRich(telegramEscapeTags(event.Text), telegramRichBytes) {
b.deliverRich(ctx, markdown)
}
}