Convert Markdown to rich text or HTML

:us_outlying_islands: I have the following flow:
Telegram BOT —> Google Gemini —> Telegram BOT

The result is a message formatted in Markdown (for example):

makefile

CopyEdit

2019: 262 billion USD  
2020: 271 billion USD  
2021: 368 billion USD  
2022: 409 billion USD  
2023: 433 billion USD (estimated)

I kindly ask for guidance on how to make the Telegram BOT message display the result in rich text or HTML format (meaning with bold text formatting, etc.).

Thank you very much!


Tôi có luồng như sau: Telegram BOT —> Goofle Gemini —>Telegram BOT

Kết quả ra tin nhắn định dạng Markdown (ví dụ:

  • 2019: 262 tỷ USD
  • 2020: 271 tỷ USD
  • 2021: 368 tỷ USD
  • 2022: 409 tỷ USD
  • 2023: 433 tỷ USD (ước tính)
    )

Kính nhờ anh/chị hướng dẫn để trong tin nhắn Telegram BOT nhận kết quả định dạng rich text hoặc HTML (nghĩa là có định dạng chữ in đậm)

Xin cảm ơn ạ!

I’ve run into the same formatting issue when passing Markdown through multiple automation layers like Telegram and Gemini. It’s easy to lose formatting or get inconsistent results depending on how the data is parsed at each step. I think the trick might be in using HTML formatting instead of Markdown if the receiving platform supports it better, or making sure you’re escaping things correctly between modules.

1 Like
This is final:
- Định dạng HTML chỉ dùng các thẻ được Telegram hỗ trợ như <b>, <strong>, <i>, <code>, <a>
- Không dùng các thẻ:  <ul>, <li>, <p>, <div>, <span>, <br>. Các thẻ khác nếu không chắc chắn hãy bỏ đi)