Every extension
kbd
A key on the keyboard, as in "press <kbd>Ctrl</kbd>".
Its own mark rather than `code` with a class: a key name is not code, a screen reader announces the two differently, and a stylesheet wants one drawn as a keycap and the other as monospace text. The two never overlap — `code` already refuses every other mark, and refusing `code` back means toggling kbd over code text swaps one for the other instead of doing nothing and looking broken.
Adding it
import { createEditor, document, paragraph, text, kbd } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, kbd],
element: document.querySelector('#editor'),
})
There is no separate package · kbd 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.toggleKbd()
Keys
- Mod-Alt-k ·
toggleKbd
HTML
-
Parses
kbd -
Renders
kbd