ExtensionsBlock syntax
Blockquote
The blockquote extension: > quotes and the blockquote commands.
The blockquote extension renders > blockquotes and adds commands to set, remove, and toggle them.
Setup
Import BlockquoteExtension and pass it through the editor’s extensions option. Create the mount
element before this code runs:
import { Editor } from "@inksane/core";
import { BlockquoteExtension } from "@inksane/core/extensions/blockquote";
const editor = new Editor({
element: document.getElementById("editor")!,
extensions: [BlockquoteExtension],
});Blockquote is included in BaseKit. Disable it with BaseKit({ blockquote: false }).
What it adds
- Decorates the
Blockquotenode with.inksane-blockquoteand hides the>markers, including the whitespace after each one. - Converts pasted
<blockquote>elements to>lines, one per line.
Commands
| Command | Description |
|---|---|
insertBlockquote({ pos? }) | Prefixes the line with > . Returns false when the line is already a quote. |
removeBlockquote({ pos? }) | Removes the > prefix. Returns false when there is none. |
toggleBlockquote({ pos? }) | insertBlockquote or removeBlockquote. |
The commands work on the line that contains the position.
editor.commands.toggleBlockquote();There is no default keybinding. Bind your own with
addKeybinds.
Styling
[data-inksane-editor-content] .inksane-blockquote {
border-left: 3px solid #303030;
padding-left: 8px;
color: #999;
}