Skip to content

README: document formatted_body for rich-text messages#12

Merged
TroyHernandez merged 1 commit into
mainfrom
docs/formatted-body
May 14, 2026
Merged

README: document formatted_body for rich-text messages#12
TroyHernandez merged 1 commit into
mainfrom
docs/formatted-body

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Summary

Adds a "Sending rich-text" section to the README explaining that markdown fences in plain `body` render as literal backticks; to get an actual code block you have to set `format = "org.matrix.custom.html"` and `formatted_body = "

"` via `mx_send`'s `extra` arg. Includes a working example and a link to the Matrix spec's allowed-tags list.

Background

Discovered while sending a multi-step build script to a Matrix room; the triple-backtick fences showed as literal text. The `extra` arg is the existing solution, just wasn't documented.

mx_send's plain body shows literal backticks in clients that render
rich text via formatted_body (Element, Cinny, etc.). Show the
extra = list(format, formatted_body) pattern with a code-block example
and link to the spec's allowed-tags list.
@TroyHernandez TroyHernandez merged commit 7e637d6 into main May 14, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the docs/formatted-body branch May 14, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant