Markdown formatting
기준일: 2026-07-26
공식 기준: Markdown formatting
Markdown formatting 문서는 OpenClaw 공식 문서(concepts/markdown-formatting)를 한국어로 정리한 가이드입니다. Markdown formatting pipeline for outbound channels 명령·설정 키·코드 예시는 공식 문서를 그대로 보존하며, 해석과 절차 안내는 한국어로 제공합니다. 최종 동작은 설치된 CLI 버전과 공식 원문을 확인하세요.
핵심 요약
Markdown formatting pipeline for outbound channels
한국어 가이드 범위: concepts/markdown-formatting 경로의 설정·명령·제약·예시를 학습용으로 재구성합니다.
문서 구성
공식 문서의 주요 섹션은 다음과 같습니다.
- Pipeline
- IR example
- Table handling
- Chunking rules
- Link policy
- Spoilers
- Adding or updating a channel formatter
- Common gotchas
- 관련 문서
상세 내용
본문
OpenClaw converts outbound Markdown into a shared intermediate representation (IR) before rendering channel-specific output. The IR keeps plain text plus style/link spans, so one parse step feeds every channel and chunking never splits formatting mid-span.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Pipeline
- Parse Markdown into IR (
markdownToIR) - plain text plus style spans (bold, italic, strikethrough, code, code block, spoiler, blockquote, heading 1-6) and link spans. Offsets are UTF-16 code units so Signal style ranges align with its API directly. Tables parse only when the channel opts into a table mode. 2. Chunk the IR (chunkMarkdownIR/renderMarkdownIRChunksWithinLimit)
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- splitting happens on IR text before rendering, so inline styles and
| Channel | Renderer | Notes |
|---|---|---|
| Slack | mrkdwn tokens (*bold*, _italic_, `code`, code fences) |
Links become <url|label>; autolink disabled during parse to avoid double-linking |
| Telegram | HTML tags (<b>, <i>, <s>, <code>, <pre><code>, <a href>, <tg-spoiler>) |
Also supports rich-message tables and headings (<h1>-<h6>) when richMessages is on |
| Signal | plain text + text-style ranges |
Links render as label (url) when the label differs from the URL |
| Discord, WhatsApp, iMessage, Microsoft Teams, and other channels | plain text | No IR-based styling; Markdown table conversion still runs via convertMarkdownTables |
IR example
Hello **world** - see [docs](https://docs.openclaw.ai).
{
"text": "Hello world - see docs.",
"styles": [{ "start": 6, "end": 11, "style": "bold" }],
"links": [{ "start": 19, "end": 23, "href": "https://docs.openclaw.ai" }]
}
Table handling
markdown.tables controls how a channel converts Markdown tables, per channel and optionally per account:
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
| Mode | Behavior |
|---|---|
code |
Render as an aligned ASCII table inside a code block (fallback default) |
bullets |
Convert each row into label: value bullet points |
block |
Keep native tables where the transport supports them; falls back to code otherwise |
off |
Disable table parsing; raw table text passes through unchanged |
channels:
discord:
markdown:
tables: code
accounts:
work:
markdown:
tables: off
Chunking rules
channels render the closing fence correctly.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Chunk limits come from channel adapters/config and apply to IR text, not
- Fenced code blocks are kept as one block with a trailing newline so
- List and blockquote prefixes are part of the IR text, so chunking never
- Inline styles never split across chunks; the renderer reopens an open
Link policy
주요 항목:
- Slack:
label-><url|label>; bare URLs stay bare. - Telegram:
label-><a href="url">label</a>(HTML parse mode). - Signal:
label->label (url)unless the label already
Spoilers
Spoiler markers (||spoiler||) are parsed for Signal (mapped to SPOILER style ranges) and Telegram (mapped to ``). Other channels treat ||...|| as plain text.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Adding or updating a channel formatter
- Parse once with
markdownToIR(...), passing channel-appropriate options (autolink,headingStyle,blockquotePrefix,tableMode). 2. Render withrenderMarkdownWithMarkers(...)and a style-marker map (or custom style-range logic for transports like Signal). 3. Chunk withchunkMarkdownIR(...)orrenderMarkdownIRChunksWithinLimit(...)before rendering each chunk. 4. Wire the adapter to call the new chunker and renderer from the outbound send path. 5. Test with format tests plus an outbound delivery test if the channel chunks.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
Common gotchas
survive escaping; raw HTML still needs to be escaped safely.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
주요 항목:
- Slack angle-bracket tokens (
<@U123>,<#C123>,<https://...>) must - Telegram HTML requires escaping text outside tags to avoid broken markup.
- Signal style ranges use UTF-16 offsets, not code-point offsets.
- Preserve trailing newlines on fenced code blocks so the closing marker
관련 문서
Outbound streaming behavior, chunk boundaries, and channel-specific delivery.
위 내용은 공식 문서의 해당 섹션 요지입니다. 세부 플래그·기본값은 원문과
--help를 확인하세요.
실습 체크리스트
- 공식 문서와 로컬 버전을 대조합니다:
https://docs.openclaw.ai/concepts/markdown-formatting - 관련 CLI는
openclaw --help및 하위 명령--help로 옵션을 확인합니다. - 설정 변경 시
openclaw config/openclaw doctor로 유효성을 검사합니다. - Gateway·채널·플러그인 변경 후에는 필요 시 Gateway를 재시작합니다.
자주 쓰는 명령·설정 예시
Hello **world** - see [docs](https://docs.openclaw.ai).
{
"text": "Hello world - see docs.",
"styles": [{ "start": 6, "end": 11, "style": "bold" }],
"links": [{ "start": 19, "end": 23, "href": "https://docs.openclaw.ai" }]
}
channels:
discord:
markdown:
tables: code
accounts:
work:
markdown:
tables: off
관련 링크
이 가이드는 공식 문서를 한국어 학습용으로 재구성한 것입니다. 옵션 기본값·플래그 이름은 설치 버전에 따라 달라질 수 있습니다.