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 ## Usage
```js ```js
// Remoe all content from the document // Remoe all content from the document
this.editor.commands.clearContent() editor.commands.clearContent()
// Remove all content, and trigger the `update` event // 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 ## Usage
```js ```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 ## Usage
```js ```js
// Plain text // Plain text
this.editor.commands.insertContent('Example Text') editor.commands.insertContent('Example Text')
// HTML // HTML
this.editor.commands.insertContent('<h1>Example Text</h1>') editor.commands.insertContent('<h1>Example Text</h1>')
// JSON/Nodes // JSON/Nodes
this.editor.commands.insertContent({ editor.commands.insertContent({
type: 'heading', type: 'heading',
attrs: { attrs: {
level: 1, level: 1,

View File

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

View File

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