This commit is contained in:
@@ -34,7 +34,7 @@ Have a look at all of the core commands listed below. They should give you a goo
|
||||
| Command | Description |
|
||||
| --------------- | ----------------------------------------------------------- |
|
||||
| .clearContent() | Clear the whole document. |
|
||||
| .insertHTML() | Insert a string of HTML at the currently selected position. |
|
||||
| .insertgetHTML() | Insert a string of HTML at the currently selected position. |
|
||||
| .insertText() | Insert a string of text at the currently selected position. |
|
||||
| .setContent() | Replace the whole document with new content. |
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@ This class is a central building block of tiptap. It does most of the heavy lift
|
||||
| `onBlur` | `Function` | `undefined` | Returns an object with the `event` and current `state` and `view` of Prosemirror on blur. |
|
||||
| `onFocus` | `Function` | `undefined` | Returns an object with the `event` and current `state` and `view` of Prosemirror on focus. |
|
||||
| `onInit` | `Function` | `undefined` | Returns an object with the current `state` and `view` of Prosemirror on init. |
|
||||
| `onUpdate` | `Function` | `undefined` | Returns an object with the current `state` of Prosemirror, a `json()` and `html()` function and the `transaction` on every change. |
|
||||
| `onUpdate` | `Function` | `undefined` | Returns an object with the current `state` of Prosemirror, a `getJSON()` and `getHTML()` function and the `transaction` on every change. |
|
||||
|
||||
## Methods
|
||||
| Method | Parameters | Description |
|
||||
| -------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
||||
| `html()` | – | Returns the current content as HTML. |
|
||||
| `json()` | – | Returns the current content as JSON. |
|
||||
| `getHTML()` | – | Returns the current content as HTML. |
|
||||
| `getJSON()` | – | Returns the current content as JSON. |
|
||||
| `destroy()` | – | Stops the editor instance and unbinds all events. |
|
||||
| `chain()` | - | Create a command chain to call multiple commands at once. |
|
||||
| `setOptions()` | `options` A list of options | Update editor options. |
|
||||
|
||||
@@ -128,7 +128,7 @@ const schema = getSchema([
|
||||
|
||||
If you need to render the content on the server side, e. g. for a blog post that was written with tiptap, you’ll probably need a way to do just that without an actual editor instance.
|
||||
|
||||
That’s what `generateHtml()` is for. It’s a utility function that renders HTML without an actual editor instance.
|
||||
That’s what `generategetHTML()` is for. It’s a utility function that renders HTML without an actual editor instance.
|
||||
|
||||
:::warning Work in progress
|
||||
Currently, that works only in the browser (client side), but we plan to bring this to Node.js (to use it on the server side).
|
||||
|
||||
Reference in New Issue
Block a user