@kerebron/extension-basic-editor
v0.5.3
Published
Set of basic editor extensions, marks and nodes
Downloads
397
Readme
Kerebron basic editor extension
Set of basic editor extensions, marks and nodes
Features:
- bold, italic, image, hr...
- basic keymap
- cursors: drop and gap
- history
Usage:
import { AdvancedEditorKit } from '@kerebron/editor-kits/AdvancedEditorKit';
this.editor = CoreEditor.create({
element: htmlElement,
editorKits: [
new AdvancedEditorKit(),
],
});const buffer = new TextEncoder().encode('# TEST \n\n1. aaa\n2. bbb');
await this.editor.loadDocument('text/x-markdown', buffer);const buffer = await this.editor.saveDocument('text/x-markdown');
const markdown = new TextDecoder().decode(buffer);