Merge branch 'main' of github.com:ueberdosis/tiptap-next into main

This commit is contained in:
Hans Pagel
2020-11-13 15:08:40 +01:00
52 changed files with 177 additions and 179 deletions

View File

@@ -25,7 +25,7 @@ import BulletList from '@tiptap/extension-bullet-list'
const CustomBulletList = BulletList.extend({
addKeyboardShortcuts() {
return {
'Mod-l': () => this.editor.bulletList(),
'Mod-l': () => this.editor.commands.bulletList(),
}
},
})
@@ -296,7 +296,7 @@ import BulletList from '@tiptap/extension-bullet-list'
const CustomBulletList = BulletList.extend({
addKeyboardShortcuts() {
return {
'Mod-l': () => this.editor.bulletList(),
'Mod-l': () => this.editor.commands.bulletList(),
}
},
})

View File

@@ -10,7 +10,7 @@ Lets start to add your first button to the editor. Once initiated the editor
<demo name="SimpleMenuBar" highlight="5-11" />
To mark selected text bold we can use `this.editor.bold`. There a ton of other commands and you can even chain them to do multiple things at once.
To mark selected text bold we can use `editor.commands.bold()`. There a ton of other commands and you can even chain them to do multiple things at once.
You might wonder what features tiptap supports out of the box. In the above example we added the `@tiptap/starter-kit`. That already includes support for paragraphs, text, bold, italic, inline code and code blocks. There are a lot more, but you have to explicitly import them. You will learn how that works in the next example.

View File

@@ -73,7 +73,7 @@ new Editor({
Or if you want to restore the content later (e. g. after an API call has finished), you can do that too:
```js
editor.setContent(`<p>Example Text</p>`)
editor.commands.setContent(`<p>Example Text</p>`)
```
## Not an option: Markdown