1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 06:31:28 +02:00

update schema customizer to merge marks (#1839)

* update schema customizer to merge marks

* update comment
This commit is contained in:
Irwan Fario Subastian
2018-06-15 10:53:33 +10:00
committed by Ian Storm Taylor
parent 844a4c0221
commit 9afffd418d

View File

@@ -558,8 +558,8 @@ function resolveNodeRule(object, type, obj) {
}
/**
* A Lodash customizer for merging schema definitions. Special cases `objects`
* and `types` arrays to be unioned, and ignores new `null` values.
* A Lodash customizer for merging schema definitions. Special cases `objects`,
* `marks` and `types` arrays to be unioned, and ignores new `null` values.
*
* @param {Mixed} target
* @param {Mixed} source
@@ -567,7 +567,7 @@ function resolveNodeRule(object, type, obj) {
*/
function customizer(target, source, key) {
if (key == 'objects' || key == 'types') {
if (key == 'objects' || key == 'types' || key == 'marks') {
return target == null ? source : target.concat(source)
} else {
return source == null ? target : source