Every extension
codeBlock
Parses pre · renders pre.
Adding it
import { createEditor, document, paragraph, text, codeBlock } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, codeBlock],
element: document.querySelector('#editor'),
})
There is no separate package · codeBlock is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.toggleCodeBlock()
Keys
- Mod-Alt-c ·
toggleCodeBlock
Attributes
-
language
HTML
-
Parses
pre -
Renders
pre