mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-21 22:02:05 +02:00
update serializers docs
This commit is contained in:
parent
93e2487c6e
commit
2ee317c0a0
@ -11,7 +11,7 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
|
||||
|
||||
- [Example](#example)
|
||||
- [Properties](#properties)
|
||||
- [`rules`]
|
||||
- [`rules`](#rules)
|
||||
- [Methods](#methods)
|
||||
- [`deserialize`](#deserialize)
|
||||
- [`serialize`](#serialize)
|
||||
@ -24,14 +24,18 @@ For an example of the `Html` serializer in action, check out the [`paste-html` e
|
||||
## Example
|
||||
|
||||
```txt
|
||||
The Slate editor gives you full control over the logic you can add.\n
|
||||
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!
|
||||
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!
|
||||
```
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
```js
|
||||
new Html({
|
||||
rules: Array
|
||||
})
|
||||
```
|
||||
|
||||
### `rules`
|
||||
`Array`
|
||||
|
||||
@ -57,6 +61,13 @@ To initialize an `Html` serialize, you must pass it an array of rules, defining
|
||||
|
||||
### Rule Properties
|
||||
|
||||
```js
|
||||
{
|
||||
deserialize: Function,
|
||||
serialize: Function
|
||||
}
|
||||
```
|
||||
|
||||
Each rule must define two properties:
|
||||
|
||||
#### `rule.deserialize`
|
||||
|
Loading…
x
Reference in New Issue
Block a user