docs: Clear up Prosemirror EditorProps usage
This commit is contained in:
@@ -187,7 +187,7 @@ new Editor({
|
||||
```
|
||||
|
||||
### Editor props
|
||||
For advanced use cases, you can pass `editorProps` which will be handled by [ProseMirror](https://prosemirror.net/docs/ref/#view.EditorProps). Here is an example how you can pass a few [Tailwind](https://tailwindcss.com/) classes to the editor container, but there is a lot more you can do.
|
||||
For advanced use cases, you can pass `editorProps` which will be handled by [ProseMirror](https://prosemirror.net/docs/ref/#view.EditorProps). Here is an example how you can pass a few [Tailwind](https://tailwindcss.com/) classes to the editor container, and transform pasted text, but there is a lot more you can do.
|
||||
|
||||
```js
|
||||
new Editor({
|
||||
@@ -196,8 +196,11 @@ new Editor({
|
||||
attributes: {
|
||||
class: 'prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none',
|
||||
},
|
||||
},
|
||||
})
|
||||
transformPastedText(text) {
|
||||
return text.toUpperCase();
|
||||
}
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
You can use that to hook into event handlers and pass - for example - a custom paste handler, too.
|
||||
|
||||
Reference in New Issue
Block a user