mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 02:03:59 +02:00
update serializers docs
This commit is contained in:
@@ -11,7 +11,7 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
|
|||||||
|
|
||||||
- [Example](#example)
|
- [Example](#example)
|
||||||
- [Properties](#properties)
|
- [Properties](#properties)
|
||||||
- [`rules`]
|
- [`rules`](#rules)
|
||||||
- [Methods](#methods)
|
- [Methods](#methods)
|
||||||
- [`deserialize`](#deserialize)
|
- [`deserialize`](#deserialize)
|
||||||
- [`serialize`](#serialize)
|
- [`serialize`](#serialize)
|
||||||
@@ -24,14 +24,18 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```txt
|
```txt
|
||||||
The Slate editor gives you full control over the logic you can add.\n
|
The Slate editor gives you full control over the logic you can add.\nIn its simplest form, when representing plain text, Slate is a glorified <textarea>. But you can augment it to be much more than that.\nCheck out http://slatejs.org for examples!
|
||||||
In its simplest form, when representing plain text, Slate is a glorified <textarea>. But you can augment it to be much more than that.\n
|
|
||||||
Check out http://slatejs.org for examples!
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
```js
|
||||||
|
new Html({
|
||||||
|
rules: Array
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
### `rules`
|
### `rules`
|
||||||
`Array`
|
`Array`
|
||||||
|
|
||||||
@@ -57,6 +61,13 @@ To initialize an `Html` serialize, you must pass it an array of rules, defining
|
|||||||
|
|
||||||
### Rule Properties
|
### Rule Properties
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
deserialize: Function,
|
||||||
|
serialize: Function
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Each rule must define two properties:
|
Each rule must define two properties:
|
||||||
|
|
||||||
#### `rule.deserialize`
|
#### `rule.deserialize`
|
||||||
|
Reference in New Issue
Block a user