docs: update content

This commit is contained in:
Philipp Kühn
2021-04-08 00:13:51 +02:00
parent e597ed9f55
commit 0e713432ae
5 changed files with 10 additions and 10 deletions

View File

@@ -13,9 +13,9 @@ By default, it doesnt trigger the update event. Passing `true` doesnt prev
## Usage
```js
// Remoe all content from the document
this.editor.commands.clearContent()
editor.commands.clearContent()
// Remove all content, and trigger the `update` event
this.editor.commands.clearContent(true)
editor.commands.clearContent(true)
```

View File

@@ -3,6 +3,6 @@ The `clearNodes` command normalizes nodes to a simple paragraph, it even normali
## Usage
```js
this.editor.commands.clearNodes()
editor.commands.clearNodes()
```

View File

@@ -11,13 +11,13 @@ The command is pretty flexible and takes plain text, HTML or even JSON as a valu
## Usage
```js
// Plain text
this.editor.commands.insertContent('Example Text')
editor.commands.insertContent('Example Text')
// HTML
this.editor.commands.insertContent('<h1>Example Text</h1>')
editor.commands.insertContent('<h1>Example Text</h1>')
// JSON/Nodes
this.editor.commands.insertContent({
editor.commands.insertContent({
type: 'heading',
attrs: {
level: 1,

View File

@@ -19,10 +19,10 @@ Options to configure the parsing can be passed during initialization and/or with
## Usage
```js
// HTML
this.editor.commands.setContent('<p>Example Text</p>')
editor.commands.setContent('<p>Example Text</p>')
// JSON
this.editor.commands.setContent({
editor.commands.setContent({
"type": "doc",
"content": [
{

View File

@@ -14,9 +14,9 @@ This expects an object with the attributes that need to be updated. It doesnt
## Usage
```js
// Update node attributes
this.editor.commands.updateAttributes('heading', { level: 1 })
editor.commands.updateAttributes('heading', { level: 1 })
// Update mark attributes
this.editor.commands.updateAttributes('highlight', { color: 'pink' })
editor.commands.updateAttributes('highlight', { color: 'pink' })
```