markdownFormatter
Builds a formatter that renders the message text as markdown, in place of defaultFormatter:
ChatTheme(
messageTextFormatter = MessageTextFormatter.markdownFormatter(autoTranslationEnabled = true),
)Mentions, links and emails are highlighted on top of the rendered markdown. Rendering changes the text's length, so offsets no longer line up with Message.text and this cannot be combined through composite, which styles by those offsets. Styling follows typography and colors.
A single line break renders as a line break, where the specification collapses it to a space. Complying would leave two trailing spaces as the only way to write one, and would reflow every multi-line message that reads correctly as plain text today. The View-based kit deviates the same way.
Emphasis, strikethrough, code, headings, lists, quotes and links are rendered. An image falls back to its alt text, and a table or task list to its source, since none of the three can be drawn in a styled string.