1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-21 22:45:18 +02:00

Merge branch 'master' of github.com:ianstormtaylor/slate

This commit is contained in:
Ian Storm Taylor
2016-07-28 11:13:50 -07:00

View File

@@ -527,11 +527,15 @@ const Transforms = {
if (typeof properties == 'string') {
properties = { type: properties }
}
if (properties.data) {
properties.data = Data.create(properties.data)
} else {
delete properties.data
}
// Update each of the blocks.
const blocks = node.getBlocksAtRange(range)
blocks.forEach((block) => {
if (properties.data) properties.data = Data.create(properties.data)
block = block.merge(properties)
node = node.updateDescendant(block)
})