Message Response Formatting

Agent message responses in the Agentforce Mobile SDK are formatted with Markdown. When the SDK renders a message, it interprets the response as Markdown and displays the styled result. The SDK does not render full HTML message responses—HTML markup in a standard message body isn’t parsed and is shown as literal text or stripped, not rendered.

Design your agent responses around Markdown for text formatting (headings, bold and italic text, lists, links, and code). Don’t rely on arbitrary HTML in message content.

Markdown in message responses 

Standard agent message responses support common Markdown, including:

  • Headings
  • Bold and italic text
  • Ordered and unordered lists
  • Links
  • Inline code and code blocks

On Android, Markdown message content is rendered by the AgentforceMarkdownRichText component. For details, see the Rich Text Display components in Android UI Components in the Agentforce Mobile SDK reference.

HTML in the lightning__richText response component 

Full HTML message responses aren’t supported, but the SDK does render HTML for the lightning__richText response component. When an agent action returns a lightning__richText component, the SDK renders its HTML content rather than treating it as Markdown.

HTML support in lightning__richText is limited, and the supported tag set isn’t identical on iOS and Android:

  • On iOS, the SDK parses HTML with its own allowlist of tags, so rendering is consistent across every device.
  • On Android, the SDK hands HTML off to the Android OS’s built-in HTML renderer, so exact rendering can vary slightly by Android version.

Keep the HTML you return in a lightning__richText component simple and within the tags supported on both platforms.

Supported HTML tags by platform 

Tag(s)iOSAndroid
<b>, <strong>BoldBold
<em>, <i>, <cite>ItalicItalic
<u>UnderlineUnderline
<ins>UnderlineNot rendered
<s>, <strike>, <del>StrikethroughStrikethrough
<a>LinkLink
<img>ImageImage
<p>ParagraphParagraph
<br>Line breakLine break
<sup>, <sub>Superscript, subscriptSuperscript, subscript
<small>Smaller textSmaller text
<ul>, <li>Bulleted listBulleted list
<ol>Numbered listBulleted list (no numbering)
<h1>–<h6>HeadingHeading
<table>, <tr>, <td>Table, with borders and stylesNot rendered (stripped to plain text)
<blockquote>Not renderedBlockquote
<code>, <pre>Not renderedMonospace-style text
<q>Not supported — rendering is inconsistentNot rendered

Tables are the biggest gap between platforms: if a response includes an HTML table, iOS renders it as a table, but Android shows only the inner text. If your agent responses can include tables, test the rendered result on both platforms before shipping.

See also