1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

Docs improvements suggestions (#801)

* Fix typo

* Make it clearer that addMark has changed too
This commit is contained in:
Asaf Katz
2017-05-21 20:36:23 +03:00
committed by Ian Storm Taylor
parent da1210da0f
commit 06c54bd991
2 changed files with 4 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
Okay, so you've got Slate installed and rendered on the page, and when you type in it, you can see the changes reflected. But you want to do more than just type a plaintext string. Okay, so you've got Slate installed and rendered on the page, and when you type in it, you can see the changes reflected. But you want to do more than just type a plaintext string.
What makes Slate great is how easy it is to customize. Just like other React components you're used it, Slate allows you to pass in handlers that are triggered on certain events. You've already seen on the `onChange` handler can be used to store the changed editor state, but let's try add something more... What makes Slate great is how easy it is to customize. Just like other React components you're used to, Slate allows you to pass in handlers that are triggered on certain events. You've already seen on the `onChange` handler can be used to store the changed editor state, but let's try add something more...
We'll show you how to use the `onKeyDown` handler to change the editor's content when the user presses a button. We'll show you how to use the `onKeyDown` handler to change the editor's content when the user presses a button.

View File

@@ -123,7 +123,9 @@ function BoldMark(props) {
Pretty simple, right? Pretty simple, right?
And now, let's tell Slate about that mark. To do that, we'll add it to the `schema` object under a `marks` property, like so: And now, let's tell Slate about that mark.
To do that, we'll add it to the `schema` object under a `marks` property.
Also, let's allow our mark to be toggled by changing `addMark` to `toggleMark`.
```js ```js
function BoldMark(props) { function BoldMark(props) {