FeaturesTypography
Blockquote
Display quoted text with `toggleBlockquote`.
Type: Node
Blockquote displays quoted text in an indented block. Renders as <blockquote> in HTML output.
Demo
Installation
import { Blockquote } from "@arkpad/extension-blockquote";Commands
The extension registers three commands for managing blockquotes:
// Toggles the current block between blockquote and a paragraph
editor.runCommand("toggleBlockquote");
// Explicitly wraps the current block inside a blockquote
editor.runCommand("setBlockquote");
// Explicitly unwraps the blockquote back into a standard paragraph
editor.runCommand("unsetBlockquote");Chaining Commands
You can chain commands to focus the editor after toggling a blockquote:
editor.chain().focus().toggleBlockquote().run();Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Mod-Shift-b | Toggles blockquote |
Active State
const isActive = editor.isActive("blockquote");Configuration
Options
| Name | Type | Default | Description |
|---|---|---|---|
HTMLAttributes | Record<string, any> | {} | Key-value pairs of attributes to be rendered on the <blockquote> DOM element. |
Blockquote.configure({
HTMLAttributes: {
class: "custom-quote-styling",
},
});