mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-12 00:19:02 +08:00
1.6 KiB
1.6 KiB
Code
The Code extensions enables you to use the <code>
HTML tag in the editor. If you paste in text with <code>
tags it will rendered accordingly.
Type something with `back-ticks around`
and it will magically transform to inline code
while you type.
Installation
# with npm
npm install @tiptap/extension-code
# with Yarn
yarn add @tiptap/extension-code
Settings
Option | Type | Default | Description |
---|---|---|---|
HTMLAttributes | Object |
{} |
Custom HTML attributes that should be added to the rendered HTML tag. |
Commands
Command | Parameters | Description |
---|---|---|
setCode | — | Mark text as inline code. |
toggleCode | — | Toggle inline code mark. |
unsetCode | — | Remove inline code mark. |
Keyboard shortcuts
Command | Windows/Linux | macOS |
---|---|---|
toggleCode() | Control E |
Cmd E |