Skip to content

Code blocks

A code block keeps text exactly as you typed it — indentation, symbols, line breaks — in a monospace tile. Use it for a macro, a JSON export, a stat block someone asked for, or anything else where the shape of the text matters.

Type three backticks on a line, optionally followed by a language, then press Enter:

```json
{ "hp": 12 }
Inline code — a single word or expression in the middle of a sentence — uses
single backticks: `` `2d6+3` ``.
## Enter inside a block adds a line
While the caret is inside a code block, **Enter** inserts a new line rather
than sending the message. To leave the block press **Enter three times** on an
empty line, or press **↓** at its end. **Ctrl+Enter** (⌘+Enter on a Mac) sends
from anywhere.
## Highlighting and copying
Blocks tagged with a language are highlighted once the message renders:
JavaScript, TypeScript, JSON, Bash, Python, SQL, CSS, HTML, Markdown, YAML,
diff and plain text (with the usual short names — `js`, `ts`, `sh`, `py`,
`yml`). A block with no language, or an unknown one, stays plain.
Every block shows its language in the corner and a **Copy** button on hover
(always visible on a phone). Copy puts the raw text on the clipboard — no
highlighting markup, no smart quotes.
<Aside type="tip">
Code blocks survive the sanitizer exactly as written. If you want to hide a
block behind a spoiler, wrap the whole block in the spoiler rather than lines
inside it.
</Aside>