6 custom skills (assign-task, dispatch-webhook, daily-briefing, task-capture, qmd-brain, tts-voice) with technical documentation. Compatible with Claude Code, OpenClaw, Codex CLI, and OpenCode.
1.6 KiB
1.6 KiB
Markdown Formatting
OpenClaw processes Markdown through an intermediate representation (IR) system that maintains consistent formatting across multiple chat platforms including Slack, Telegram, and Signal.
Core Architecture
The system operates in three stages:
- Parsing Markdown into an IR format
- Chunking the IR text before rendering
- Converting to channel-specific output
The IR preserves plain text plus style spans (bold/italic/strike/code/spoiler) and link spans, using UTF-16 code units for offset compatibility.
Key Design Principles
The approach aims to achieve:
- Consistency: Single parsing step with multiple renderers
- Safe chunking: Avoid splitting inline formatting
- Adaptability: Same IR works across different platform requirements without re-parsing
Channel-Specific Rendering
Each platform receives tailored output:
| Platform | Formatting |
|---|---|
| Slack | Uses mrkdwn formatting with <url|label> link syntax |
| Telegram | Applies HTML tags for styling and links |
| Signal | Employs plain text with style ranges; links display as "label (url)" |
Table Handling
Tables support three modes:
- Code blocks (default)
- Bullet-point conversion
- Disabled parsing
Configuration allows per-channel and per-account customization.
Implementation Guidance
Adding formatters requires:
- Parsing with appropriate options
- Implementing channel-specific renderers
- Calling the chunking function before rendering
- Updating the adapter
- Adding test coverage for both formatting and delivery