1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-24 16:02:55 +02:00

Fixed syntax mismatch at normalize method (#1737)

`switch` operator was wrapped around `case` statements
This commit is contained in:
Nikolay Kazakov
2018-03-28 21:15:12 +05:00
committed by Ian Storm Taylor
parent 950c5a92e1
commit d2eb362234

View File

@@ -168,12 +168,14 @@ Will validate a node's marks. The `marks` definitions can declare a list of mark
```js
{
normalize: (change, violation, context) => {
case 'child_object_invalid':
change.wrapBlockByKey(context.child.key, 'paragraph')
return
case 'child_type_invalid':
change.setNodeByKey(context.child.key, 'paragraph')
return
switch (violation) {
case 'child_object_invalid':
change.wrapBlockByKey(context.child.key, 'paragraph')
return
case 'child_type_invalid':
change.setNodeByKey(context.child.key, 'paragraph')
return
}
}
}
```