mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-30 10:29:48 +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,
|
||||
last: Object,
|
||||
nodes: Array,
|
||||
marks: Array,
|
||||
normalize: Function,
|
||||
parent: Object,
|
||||
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.
|
||||
|
||||
### `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(change: Change, violation: String, context: Object) => Void`
|
||||
|
Reference in New Issue
Block a user