---
schema_version: "1"
id: f795054c4f5d9ccfda0d830829b24a390067dd465501805fe83f27daceb5fb63
title: Send and Receive Richly Formatted Messages with Markdown
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/messaging-byoc-ccaas/guides/markdown.md
canonical_url: https://developer.salesforce.com/docs/service/messaging-byoc-ccaas/guide/markdown.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 46325db0c0431f526fcc49bb344a21ec4c4abe4f36e79901191017f0c534dc6f
products:
  - Bring Your Own Channel for CCaaS
  - Service Cloud Developer Content
---
# 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. As a partner, learn how to configure Markdown support in your Bring Your Own Channel for CCaaS client application.

## About Markdown Support

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.

### Markdown Implementation Considerations

- The default parser option uses GitHub Flavored Markdown (GFM).
- You can customize rendering options using the [Marked configuration](https://marked.js.org/using_advanced#options).
- For advanced Markdown types like tables, headings, and blockquotes, make sure your client-side styles support the expected output.

## Add Markdown Support

1. Include the `marked.esm.js` library in your codebase.
2. Import the library in your code.

```Javascript
import { marked } from "./marked.esm.js";
```

3. Implement a Markdown parser with this example function.

```Javascript
/**
* Converts Markdown-formatted text to HTML using the Marked parser.
*
* @param {string} text - The Markdown string to convert.
* @returns {string} The rendered HTML.
*/
function parseMarkdownToHtml(text) {
   if (!text) {
       return "";
   }
   try {
       // Use GitHub Flavored Markdown (GFM) by default.
       // See available options: https://marked.js.org/using_advanced#options
       return marked.parse(text);
   } catch (e) {
       LoggingUtil.logError(e, COMPONENT_NAME, {
           method: "parseMarkdownToHtml",
           errMessage: "Error parsing Markdown input."
       });
       return "";
   }
}
```

## Example Usage

Here’s an example of a message that a rep sends from the console in Markdown.

```
Hello **Partner** 👋

Here are the steps:
1. Open the chat window
2. Type your *message*
3. Add a [link](https://salesforce.com) if needed
- Works with bullet lists
- Works with numbered lists
```

The output renders for the end user in the chat application like this.

Hello **Partner** 👋  
Here are the steps:

1. Open the chat window
2. Type your _message_
3. Add a [link](https://salesforce.com) if needed

- Works with bullet lists
- Works with numbered lists

**See Also**

- _GitHub_: [Demo connector implementation](https://github.com/salesforce-misc/byo-demo-connector/blob/markdown-helper-dic/src/common/marked.esm.js) of `marked.esm.js`
- _GitHub_: [Marked](https://github.com/markedjs/marked)
- _CommonMark_: [Markdown Reference and Tutorial](https://commonmark.org/help/)

