npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-telegram-better-markdown

v1.0.0

Published

n8n node to convert Markdown to Telegram-compatible HTML for use with Telegram Bot API

Readme

n8n-nodes-telegram-better-markdown

This is an n8n community node that converts Markdown text to Telegram-compatible HTML format for use with the Telegram Bot API.

The node allows you to take regular Markdown text (including output from LLMs) and convert it to properly formatted HTML that displays beautifully in Telegram messages. It supports standard Markdown syntax plus Telegram-specific features like spoilers, user mentions, custom emojis, and expandable blockquotes.

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation.

Alternatively, install directly via npm:

npm install n8n-nodes-telegram-better-markdown

Features

  • ✅ Converts standard Markdown to Telegram HTML format
  • ✅ Supports all Telegram formatting tags (bold, italic, strikethrough, code, links, etc.)
  • ✅ Handles Telegram-specific features:
    • Spoilers (||text||)
    • User mentions ([name](tg://user?id=123456789))
    • Custom emojis (![👍](tg://emoji?id=5368324170671202286))
    • Expandable blockquotes (automatic or manual)
  • ✅ Properly escapes HTML special characters
  • ✅ Handles nested lists with proper indentation
  • ✅ Code blocks with language syntax highlighting
  • ✅ Perfect for processing LLM output for Telegram bots

Usage

  1. Add the Telegram Markdown node to your n8n workflow
  2. Connect it to a node that provides text data (e.g., OpenAI, HTTP Request, or any data source)
  3. Configure the node:
    • Markdown Text: The markdown content to convert (can use expressions to reference data from previous nodes)
    • Output Field: The name of the field where the converted HTML will be stored (default: telegramHtml)
  4. Connect the output to a Telegram node or any other node that needs the formatted HTML

Example Workflow

LLM Node → Telegram Markdown → Telegram Bot (sendMessage)

In the Telegram node, set:

  • Text: {{ $json.telegramHtml }}
  • Parse Mode: HTML

Supported Markdown Features

| Markdown | Output | Telegram Tag | |----------|--------|--------------| | **bold** or __bold__ | bold | <b> | | *italic* or _italic_ | italic | <i> | | ~~strikethrough~~ | ~~strikethrough~~ | <s> | | `code` | code | <code> | | ```code block``` | code block | <pre><code> | | [link](url) | link | <a href=""> | | # Heading | Heading | <b> | | > quote | quote | <blockquote> | | - list item | • list item | Formatted list | | 1. item | 1. item | Formatted list | | --- | ------ | Horizontal rule |

Telegram-Specific Features

Spoilers

Use double pipes to create spoiler text:

This is ||hidden text|| that can be revealed

User Mentions

Link to Telegram users using their user ID:

Hello [John](tg://user?id=123456789)!

Custom Emojis

Reference custom emojis by their emoji ID:

Great work! ![👍](tg://emoji?id=5368324170671202286)

Expandable Blockquotes

Blockquotes automatically become expandable if they:

  • Are longer than 320 characters, OR
  • Have more than 4 lines

You can also explicitly mark a blockquote as expandable by ending it with ||:

> This is a long quote that will be expandable.
> It contains important information.
> Users can tap to expand it.||

Nested Lists

The node properly handles nested lists with automatic indentation:

- Parent item
  - Nested item
    - Deeper nested item
- Another parent

Examples

Basic Formatting

Input:

# Welcome to My Bot

This is **bold** and this is *italic*.

Check out this [link](https://example.com).

Output:

<b>Welcome to My Bot</b>
This is <b>bold</b> and this is <i>italic</i>.
Check out this <a href="https://example.com">link</a>.

Code Blocks

Input:

Here's some code:

```javascript
function hello() {
  console.log("Hello, world!");
}
```

Output:

Here's some code:
<pre><code class="language-javascript">function hello() {
  console.log(&quot;Hello, world!&quot;);
}</code></pre>

LLM Integration Example

When using with an LLM like ChatGPT:

  1. OpenAI Node → outputs markdown response
  2. Telegram Markdown Node → converts to HTML
  3. Telegram Node → sends formatted message

This allows your bot to display beautifully formatted messages with all the markdown features that LLMs naturally generate.

Compatibility

  • Minimum n8n version: 0.200.0
  • Tested on: n8n 1.0.0+
  • Telegram Bot API: Compatible with all current versions

Resources

Version History

0.1.0 (Initial Release)

  • Full Markdown to Telegram HTML conversion
  • Support for all Telegram formatting tags
  • Spoiler syntax support
  • User mentions and custom emojis
  • Expandable blockquotes (automatic and manual)
  • Nested list handling with proper indentation
  • Code blocks with syntax highlighting support