2020-08-19 03:39:41 +08:00
|
|
|
|
# Code
|
2020-09-02 21:26:46 +08:00
|
|
|
|
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.
|
2020-08-19 03:39:41 +08:00
|
|
|
|
|
2020-08-20 21:33:16 +08:00
|
|
|
|
## Options
|
2020-09-09 22:15:22 +08:00
|
|
|
|
| Option | Type | Default | Description |
|
|
|
|
|
| ------ | ---- | ------- | ----------- |
|
|
|
|
|
| class | string | – | Add a custom class to the rendered HTML tag. |
|
2020-08-19 03:39:41 +08:00
|
|
|
|
|
2020-08-20 21:33:16 +08:00
|
|
|
|
## Commands
|
|
|
|
|
| Command | Options | Description |
|
2020-09-02 21:26:46 +08:00
|
|
|
|
| ------- | ------- | ----------- |
|
|
|
|
|
| code | — | Mark text as inline code. |
|
2020-08-19 03:39:41 +08:00
|
|
|
|
|
2020-08-20 21:33:16 +08:00
|
|
|
|
## Keybindings
|
2020-08-19 03:39:41 +08:00
|
|
|
|
* `Alt` + `
|
|
|
|
|
|
2020-09-02 21:26:46 +08:00
|
|
|
|
## Source Code
|
|
|
|
|
[packages/extension-code/](https://github.com/ueberdosis/tiptap-next/blob/main/packages/extension-code/)
|
2020-08-19 03:39:41 +08:00
|
|
|
|
|
2020-09-02 21:26:46 +08:00
|
|
|
|
## Usage
|
|
|
|
|
<demo name="Extensions/Code" highlight="3-5,17,36" />
|