Skip to content

Vizel API / core/src / setVizelMarkdown

Function: setVizelMarkdown() ​

ts
function setVizelMarkdown(
   editor, 
   markdown, 
   options?
): boolean;

Defined in: packages/core/src/utils/markdown.ts:49

Set markdown content to the editor.

Returns true if the operation succeeded, false only when the editor reference is missing. The Markdown extension is always-on, so no capability check is required.

Parameters ​

ParameterTypeDescription
editorEditor | null | undefinedThe editor instance
markdownstringThe markdown content to set
options{ onError?: (err) => void; transformDiagrams?: boolean; }Options for setting content
options.onError?(err) => void-
options.transformDiagrams?boolean-

Returns ​

boolean

Whether the markdown was applied to the editor

Released under the MIT License.