feat: add exitOnTripleEnter and exitOnArrowDown options to CodeBlock extension

This commit is contained in:
Philipp Kühn
2022-01-05 10:21:23 +01:00
parent 07184fe254
commit a35b7fbe2c
2 changed files with 62 additions and 13 deletions

View File

@@ -22,17 +22,6 @@ npm install @tiptap/extension-code-block
## Settings
### HTMLAttributes
Custom HTML attributes that should be added to the rendered HTML tag.
```js
CodeBlock.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
})
```
### languageClassPrefix
Adds a prefix to language classes that are applied to code tags.
@@ -44,6 +33,39 @@ CodeBlock.configure({
})
```
### exitOnTripleEnter
Define whether the node should be exited on triple enter.
Default: `true`
```js
CodeBlock.configure({
exitOnTripleEnter: false,
})
```
### exitOnArrowDown
Define whether the node should be exited on arrow down if there is no node after it.
Default: `true`
```js
CodeBlock.configure({
exitOnArrowDown: false,
})
```
### HTMLAttributes
Custom HTML attributes that should be added to the rendered HTML tag.
```js
CodeBlock.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
})
```
## Commands
### setCodeBlock()