Skip to content

Vizel API / core/src / createVizelMarkdownExtension

Function: createVizelMarkdownExtension()

ts
function createVizelMarkdownExtension(options?): Extension<MarkdownOptions>;

Defined in: packages/core/src/extensions/markdown.ts:166

Create a configured Markdown extension.

The extension wires tiptap-markdown into the editor and bridges the Vizel flavor plugin system. The returned extension is also responsible for attaching editor.getMarkdown() and editor.markdown.parse once the editor finishes initialization.

Parameters

ParameterType
optionsVizelMarkdownOptions

Returns

Extension&lt;MarkdownOptions&gt;

Examples

Basic usage

typescript
import { createVizelMarkdownExtension } from '@vizel/core';

const editor = new Editor({
  extensions: [createVizelMarkdownExtension()],
});
editor.getMarkdown();

With a flavor

typescript
import { createVizelMarkdownExtension, vizelGfmFlavor } from '@vizel/core';

const ext = createVizelMarkdownExtension({ flavor: vizelGfmFlavor });

Released under the MIT License.