Install
$ agentstack add skill-serejaris-telegram-skills-tg-markdown-to-rich ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
tg-markdown-to-rich
Converts a Markdown file (or stdin) into a Telegram InputRichMessage JSON object. The output uses the markdown field of InputRichMessage and is ready to pass directly to [sendRichMessage](../../reference/rich-messages-spec.md).
See also: [../tg-rich-messages/SKILL.md](../tg-rich-messages/SKILL.md) for composing rich messages programmatically.
Usage
# File input → stdout JSON
python3 scripts/md2rich.py document.md
# Pipe stdin
cat report.md | python3 scripts/md2rich.py
# Additional flags
python3 scripts/md2rich.py document.md --rtl
python3 scripts/md2rich.py document.md --skip-entity-detection
# Send directly via Telegram Bot API
TELEGRAM_BOT_TOKEN= python3 scripts/md2rich.py document.md \
--send --chat-id
Output is a JSON object:
{
"markdown": "# Title\n\nContent..."
}
Pass this as the rich_message parameter to sendRichMessage.
Markdown → Rich block mapping
| Markdown syntax | Rich block / inline | |---|---| | # H1 … ###### H6 | heading block (size 1–6) | | Paragraph text | paragraph block | | **bold** / __bold__ | bold inline | | *italic* / _italic_ | italic inline | | ` code | code inline | | ~~strikethrough~~ | strikethrough inline | | ==marked== | marked inline | | \|\|spoiler\|\| | spoiler inline | | `lang … ` | pre block (with language) | | [text](url) | url inline | | [text](mailto:…) | emailaddress inline | | [text](tel:…) | phonenumber inline | | [text](tg://user?id=…) | textmention inline | | $LaTeX$ | mathematicalexpression inline | | $$LaTeX$$ / ``math | mathematical_expression block | | --- | divider block | | > text | blockquote block | | - item / * item | list block (unordered) | | 1. item | list block (ordered) | | - [ ] task / - [x] task | list block with checkbox | | GFM table \| … \| | table block | | ` (block-level) | photo block (with optional caption from title) | | [^id]: … footnote | reference inline + reference_link | | / | underline inline (HTML pass-through) | | / | subscript / superscript inline | | …… | pullquote block | | …… | details block | | … | collage block | | … | slideshow` block |
Limits enforced (exit 1 on violation)
| Limit | Value | |---|---| | Max characters (UTF-8) | 32 768 | | Max blocks (incl. nested) | 500 | | Max nesting depth | 16 | | Max media blocks | 50 | | Max table columns | 20 |
Unsupported inputs and fallback behavior
| Input | Behavior | |---|---| | Block-level media with non-http/https URL | Warning to stderr; passed through as-is (Telegram will likely reject it) | | Nested blocks inside table cells | GFM spec disallows this; content treated as inline text (Telegram cells accept only inline formatting) | | data: image URIs | Passed through with a warning; Telegram only accepts http/https media URLs | | ` HTML tag | Passed through unchanged; not generatable from plain Markdown | | RichBlockThinking | Not producible from Markdown (only valid in sendRichMessageDraft`) | | HTML tags not in Rich HTML spec | Passed through; Telegram will ignore unknown tags |
References
- Canonical spec: [
../../reference/rich-messages-spec.md](../../reference/rich-messages-spec.md) - Related skill: [
../tg-rich-messages/SKILL.md](../tg-rich-messages/SKILL.md)
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: serejaris
- Source: serejaris/telegram-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.