Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Create Markdown message

Create a message containing raw Markdown text.

Copy

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

ParameterTypeRequiredDescription
contentstringYesRaw Markdown source text.

Return value

Returns a Promise resolving to CreateMarkdownMessageResp:

PropertyTypeDescription
messageIMMessageLocally 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.