SDKsuni-app / uni-app x
Create a Markdown message
Construct a pending message containing Markdown-formatted source text.
Invoke createMarkdownMessage() to construct a pending message containing Markdown source text. The content parameter expects unrendered Markdown markup, not compiled HTML.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Unrendered Markdown source text string. |
Code example
import { createMarkdownMessage } from '@/uni_modules/unix-openim-sdk'
const message = await createMarkdownMessage({
content: '**Release complete**\n\nPlease review the release notes.',
})
if (message == null) returnReceiving clients should use a secure, sandboxed Markdown parser, restricting untrusted links, images, or script execution. Clients that do not support rich rendering should display the raw text content gracefully.
Return value
The Promise resolves with an OpenIMMessageItem | null object.
State changes after the call
Pass the constructed message item to Send a message. Track message status updates in your UI state using clientMsgID.
Was this page helpful?