Browse SDKs · uni-app / uni-app x
Platform
SDKsuni-app / uni-app x

Create a Markdown message

Construct a pending message containing Markdown-formatted source text.

Copy

Invoke createMarkdownMessage() to construct a pending message containing Markdown source text. The content parameter expects unrendered Markdown markup, not compiled HTML.

Parameters

ParameterTypeRequiredDescription
contentstringYesUnrendered 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) return

Receiving 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.