mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-31 19:01:54 +02:00
Add missing documentation for rule.marks (#1717)
This commit is contained in:
committed by
Ian Storm Taylor
parent
b17bf1a7b9
commit
29901f0888
@@ -73,6 +73,7 @@ A dictionary of inlines by type, each with its own set of validation rules.
|
|||||||
isVoid: Boolean,
|
isVoid: Boolean,
|
||||||
last: Object,
|
last: Object,
|
||||||
nodes: Array,
|
nodes: Array,
|
||||||
|
marks: Array,
|
||||||
normalize: Function,
|
normalize: Function,
|
||||||
parent: Object,
|
parent: Object,
|
||||||
text: RegExp,
|
text: RegExp,
|
||||||
@@ -148,6 +149,18 @@ Will validate a node's children. The `nodes` definitions can declare the `object
|
|||||||
|
|
||||||
> 🤖 The `nodes` array is order-sensitive! The example above will require that the first node be either an `image` or `video`, and that it be followed by one or more `paragraph` nodes.
|
> 🤖 The `nodes` array is order-sensitive! The example above will require that the first node be either an `image` or `video`, and that it be followed by one or more `paragraph` nodes.
|
||||||
|
|
||||||
|
### `marks`
|
||||||
|
|
||||||
|
`Array`
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
marks: ['italic']
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Will validate a node's marks. The `marks` definitions can declare a list of marks type to be allowed. If declared, any marks that are not in the list will be removed.
|
||||||
|
|
||||||
### `normalize`
|
### `normalize`
|
||||||
|
|
||||||
`normalize(change: Change, violation: String, context: Object) => Void`
|
`normalize(change: Change, violation: String, context: Object) => Void`
|
||||||
|
Reference in New Issue
Block a user