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
| Parameter | Type |
|---|---|
options | VizelMarkdownOptions |
Returns
Extension<MarkdownOptions>
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 });