Send and Receive Richly Formatted Messages with Markdown
Customers, Salesforce reps, and AI agents can apply certain Markdown syntax elements, such as bulleted lists, italics, and hyperlinks, to messages instead of using plain text. Learn how to configure Markdown support in your Bring Your Own Channel for Messaging client application.
Our demo connector client application and Salesforce rep console support these basic Markdown syntax elements.
- Bulleted lists
- Numbered lists
- Italics
- Bold text
- Hyperlinks
To keep a consistent rendering experience across both the demo connector and the Salesforce internal platform, we use the marked.esm.js library, which follows the CommonMark specification. We recommend using Marked for your client applications as well.
While the demo connector supports the five basic Markdown syntax elements, you can extend your client application to support the full CommonMark specification. Note that certain Markdown syntax elements may render differently depending on your client-side language and framework, potentially requiring CSS adjustments.
- The default parser option uses GitHub Flavored Markdown (GFM).
- You can customize rendering options using the Marked configuration.
- For advanced Markdown types like tables, headings, and blockquotes, make sure your client-side styles support the expected output.
- Include the
marked.esm.jslibrary in your codebase. - Import the library in your code.
- Implement a Markdown parser with this example function.
Hereโs an example of a message that a rep sends from the console in Markdown.
The output renders for the end user in the chat application like this.
Hello Partner ๐
Here are the steps:
- Open the chat window
- Type your message
- Add a link if needed
- Works with bullet lists
- Works with numbered lists
See Also
- GitHub: Demo connector implementation of
marked.esm.js - GitHub: Marked
- CommonMark: Markdown Reference and Tutorial