feat: add insertContent() command, deprecate insertText(), insertHTML() and insertNode()
This commit is contained in:
23
docs/src/docPages/api/commands/insert-content.md
Normal file
23
docs/src/docPages/api/commands/insert-content.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# insertContent
|
||||
|
||||
## Parameters
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
this.editor.commands.insertContent('text')
|
||||
this.editor.commands.insertContent('<p>HTML</p>')
|
||||
this.editor.commands.insertContent({
|
||||
type: 'heading',
|
||||
attrs: {
|
||||
level: 2,
|
||||
},
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'nested nodes',
|
||||
},
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# insertHTML
|
||||
|
||||
|
||||
See also: [insertText](/api/commands/insert-text), [insertNode](/api/commands/insert-node)
|
||||
|
||||
## Parameters
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
this.editor.commands.insertHTML('<p>Example text</p>')
|
||||
```
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# insertNode
|
||||
|
||||
|
||||
See also: [insertHTML](/api/commands/insert-html), [insertText](/api/commands/insert-text)
|
||||
|
||||
## Parameters
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
this.editor.commands.insertNode('paragraph')
|
||||
```
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# insertText
|
||||
|
||||
See also: [insertHTML](/api/commands/insert-html), [insertNode](/api/commands/insert-node)
|
||||
|
||||
## Parameters
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
this.editor.commands.insertText('Example text')
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user