SDKsHarmonyOSEnterprise
Create Markdown message
Create a message containing raw Markdown text.
Creates a message containing raw Markdown syntax for formatting and rich text presentation.
Code example
import sdk, { CreateMarkdownMessageReq, CreateMarkdownMessageResp } from '@openimsdk/imsdk';
const request: CreateMarkdownMessageReq = {
content: '**Deployment Complete**\n\nPlease review release notes.',
};
const response: CreateMarkdownMessageResp = await sdk.createMarkdownMessage(request);
const message = response.message;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | Raw Markdown source text. |
Return value
Returns a Promise resolving to CreateMarkdownMessageResp:
| Property | Type | Description |
|---|---|---|
message | IMMessage | Locally instantiated Markdown message object. |
State changes after the call
content contains raw Markdown source text rather than pre-rendered HTML. Receiving clients should render content using a sandboxed parser that sanitizes links, images, and raw HTML elements, falling back to plain text for unsupported clients. This operation creates the message object locally; call Send message to transmit it.
Was this page helpful?