Skip to content

Vizel API / core/src / convertVizelCodeBlocksToDiagrams

Function: convertVizelCodeBlocksToDiagrams()

ts
function convertVizelCodeBlocksToDiagrams(editor): void;

Defined in: packages/core/src/utils/editorHelpers.ts:348

Convert all diagram code blocks in a document to diagram nodes. This command should be called after importing markdown content. Supports mermaid, dot, and graphviz code blocks.

Parameters

ParameterTypeDescription
editorEditorThe editor instance

Returns

void

Example

typescript
editor.commands.setContent(markdownText, { contentType: 'markdown' });
convertVizelCodeBlocksToDiagrams(editor);

Released under the MIT License.