/

Spectrum supports sending markdown in iMessage, Telegram, and WhatsApp

Photon

No headings found on page

Start building
with Spectrum

Deploy AI agents
across every channel

Learn more about Spectrum

Preface

Preface

Spectrum now lets you send styled text in iMessage, Telegram, and WhatsApp — bold, italic, strikethrough, and code blocks — written in standard Markdown.

What shipped

Spectrum adds a markdown() function that accepts CommonMark (plus GFM tables and strikethrough) and renders it through each provider's native formatting model. On iMessage, that means UTF-16 styled text formatting ranges in remote mode. On Telegram, it renders via parse_mode: "HTML". On WhatsApp, it maps to native formatting. Platforms without native Markdown support receive clean plain text via the send pipeline's automatic fallback.

import { markdown } from "spectrum-ts";

await space.send(markdown("**Bold** and _italic_ text."));
import { markdown } from "spectrum-ts";

await space.send(markdown("**Bold** and _italic_ text."));
import { markdown } from "spectrum-ts";

await space.send(markdown("**Bold** and _italic_ text."));

Supported styles:

  • Bold

  • Italic

  • Strikethrough

  • Code blocks — on iMessage, rendered via mathematical ASCII Unicode characters; on Telegram and WhatsApp, rendered as native code blocks

Why it matters

These platforms support styled text, but not Markdown or HTML directly. Spectrum bridges that gap — you write standard Markdown, and each platform gets native formatting. No workarounds, no raw ** markers leaking into messages.

This is useful for:

  • Automated notifications and alerts sent via iMessage, Telegram, or WhatsApp

  • AI-powered bots that stream styled responses

  • Any workflow where you want formatted text across multiple platforms

Streaming markdown

markdown() also accepts a stream source. Markdown streams render progressively on Telegram and WhatsApp. On other platforms, the accumulated text falls back through the pipeline cleanly.

import { markdown } from "spectrum-ts";
import { streamText as aiStreamText } from "ai";

const result = aiStreamText({ model, prompt: message.content.text });
await space.send(markdown(result));
import { markdown } from "spectrum-ts";
import { streamText as aiStreamText } from "ai";

const result = aiStreamText({ model, prompt: message.content.text });
await space.send(markdown(result));
import { markdown } from "spectrum-ts";
import { streamText as aiStreamText } from "ai";

const result = aiStreamText({ model, prompt: message.content.text });
await space.send(markdown(result));

Markdown is outbound-only by design. Inbound messages always surface as text content regardless of platform formatting.

Get started

Upgrade today and start sending styled messages across iMessage, Telegram, and WhatsApp.


Subscribe Photon Newsletter

Subscribe
Photon Newsletter