A TypeScript library that converts ChatGPT-style Markdown into HTML compatible with the Telegram Bot API. It supports bold, italic, underline, strikethrough, spoiler, headings, lists, links, inline code, code blocks with language hints, blockquotes, and expandable blockquotes. Version 0.1.2, works with Node >=18, includes a CLI tool, and can split long messages into Telegram-safe chunks (≤4096 characters). Originally a port of a Python module, it provides strong typing via TypeScript.
npm install telegram-markdown-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a Markdown string (including headings, bold, italic, code block, blockquote, list, link) to Telegram-compatible HTML.
Sanitize input or wrap output in a CDATA section if necessary.
Use **text** for bold/highlights in plain text instead of headings.
Flatten or manually nest by combining HTML tags directly.
Use dynamic import() in CommonJS: import('telegram-markdown-formatter').then(m => m.telegramFormat(text)).Use import syntax or dynamic import() instead of require().
Use `import { telegramFormat } from 'telegram-markdown-formatter'`.Use named import: `import { telegramFormat } from 'telegram-markdown-formatter'`.No dependency data recorded yet.