Overview
This node converts standard Markdown text into a format compatible with Telegram's Markdown style. It is useful when you want to prepare Markdown content for sending messages via Telegram bots or APIs, ensuring that the formatting appears correctly in Telegram clients.
Common scenarios include:
- Preparing user-generated Markdown content for Telegram messaging.
- Automating message formatting in workflows that send notifications or updates through Telegram.
- Sanitizing or adapting Markdown input to comply with Telegram's supported tags and syntax.
For example, if you have a Markdown string with bold, italic, or links, this node will transform it so that Telegram can render those styles properly.
Properties
| Name | Meaning |
|---|---|
| Markdown Text | The Markdown text to convert to Telegram Markdown format. |
| Unsupported Tags Strategy | What to do with unsupported tags in the Markdown text. Options: Escape, Remove, Keep as is. |
- Markdown Text: Input the Markdown content you want to convert.
- Unsupported Tags Strategy: Defines how to handle Markdown tags that Telegram does not support:
- Escape: Escape unsupported tags so they appear as plain text.
- Remove: Remove unsupported tags entirely.
- Keep: Leave unsupported tags unchanged.
Output
The node outputs an array of items where each item's json field contains a property named markdownText. This property holds the converted Markdown string formatted specifically for Telegram.
Example output JSON structure per item:
{
"json": {
"markdownText": "<Telegram-compatible Markdown string>"
}
}
No binary data output is produced by this node.
Dependencies
- Uses the external library
telegramify-markdownto perform the conversion from standard Markdown to Telegram Markdown. - No additional API keys or external service credentials are required.
- Requires the node to be run within an n8n environment supporting JavaScript execution and npm package usage.
Troubleshooting
- Error during conversion: If the input Markdown text is malformed or contains unexpected characters, the conversion might fail. Ensure the Markdown input is valid.
- Unsupported tags handling: Choosing the wrong strategy for unsupported tags may lead to unexpected output. For example, keeping unsupported tags might cause Telegram to display raw tags instead of formatted text.
- Continue on Fail: If enabled, the node will continue processing other items even if one fails, attaching error details to the output. Otherwise, it will throw an error stopping execution.
Links and References
- Telegram Markdown Style Guide
- telegramify-markdown GitHub Repository (for more details on the conversion library)