diff --git a/adapters/telegram/src/message.ts b/adapters/telegram/src/message.ts index 237370ff..7581881f 100644 --- a/adapters/telegram/src/message.ts +++ b/adapters/telegram/src/message.ts @@ -221,8 +221,10 @@ export class TelegramMessageEncoder extends Message await this.render(children) this.payload.caption += '' } else if (type === 'code') { + this.payload.caption += `${attrs.content ? h.escape(attrs.content) : children.toString()}` + } else if (type === 'code-block') { const { lang } = attrs - this.payload.caption += `${h.escape(attrs.content)}` + this.payload.caption += `
${children.toString()}
` } else if (type === 'at') { if (attrs.id) { this.payload.caption += `@${attrs.name || attrs.id}`