Skip to content

Vizel API / core/src / parseVizelMarkdown

Function: parseVizelMarkdown()

ts
function parseVizelMarkdown(
   editor, 
   markdown, 
   options?): JSONContent | null;

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

Parse markdown to JSON content.

Returns null only when the editor reference is missing. The Markdown extension is always-on, so editor.markdown.parse is guaranteed to exist.

Parameters

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

Returns

JSONContent | null

The parsed JSON content, or null if the editor is missing

Released under the MIT License.