0.8.7 • Published 21h ago
@kerebron/extension-basic-editor
Licence
MIT
Version
0.8.7
Deps
5
Size
558 kB
Vulns
0
Weekly
0
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);