1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-11 09:43:58 +02:00

fix some doc's bug (with v0.57.1) (#3393)

* fix: code blocks's info string
this info string. should be `jsx`

* fix: editor's exec invoke
now, editor.exec() is not available in Slate v0.57.1
so, use editor.insertText() to instead it

*  refactor: delete a nerver used value

* update add new chinese translate
      update chinese translate to `v0.57.1`

Co-authored-by: Ian Storm Taylor <ian@ianstormtaylor.com>
This commit is contained in:
Xleine
2020-01-28 04:24:15 +08:00
committed by Ian Storm Taylor
parent 8202e08102
commit 217bdd611b
7 changed files with 28 additions and 38 deletions

View File

@@ -10,7 +10,7 @@ Let's see how this works.
We'll start with our app from earlier:
```js
```jsx
const App = () => {
const editor = useMemo(() => withReact(createEditor()), [])
const [value, setValue] = useState([
@@ -78,7 +78,7 @@ It has the concept of "code blocks" and "bold formatting". But these things are
We can instead implement these domain-specific concepts by creating custom helper functions:
```js
```jsx
// Define our own custom set of helpers.
const CustomEditor = {
isBoldMarkActive(editor) {
@@ -172,7 +172,7 @@ const App = () => {
Now our commands are clearly defined and you can invoke them from anywhere we have access to our `editor` object. For example, from hypothetical toolbar buttons:
```js
```jsx
const App = () => {
const editor = useMemo(() => withReact(createEditor()), [])
const [value, setValue] = useState([