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:
committed by
Ian Storm Taylor
parent
844a4c0221
commit
9afffd418d
@@ -558,8 +558,8 @@ function resolveNodeRule(object, type, obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Lodash customizer for merging schema definitions. Special cases `objects`
|
* A Lodash customizer for merging schema definitions. Special cases `objects`,
|
||||||
* and `types` arrays to be unioned, and ignores new `null` values.
|
* `marks` and `types` arrays to be unioned, and ignores new `null` values.
|
||||||
*
|
*
|
||||||
* @param {Mixed} target
|
* @param {Mixed} target
|
||||||
* @param {Mixed} source
|
* @param {Mixed} source
|
||||||
@@ -567,7 +567,7 @@ function resolveNodeRule(object, type, obj) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function customizer(target, source, key) {
|
function customizer(target, source, key) {
|
||||||
if (key == 'objects' || key == 'types') {
|
if (key == 'objects' || key == 'types' || key == 'marks') {
|
||||||
return target == null ? source : target.concat(source)
|
return target == null ? source : target.concat(source)
|
||||||
} else {
|
} else {
|
||||||
return source == null ? target : source
|
return source == null ? target : source
|
||||||
|
Reference in New Issue
Block a user