1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 15:02:51 +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') { if (typeof properties == 'string') {
properties = { type: properties } properties = { type: properties }
} }
if (properties.data) {
properties.data = Data.create(properties.data)
} else {
delete properties.data
}
// Update each of the blocks. // Update each of the blocks.
const blocks = node.getBlocksAtRange(range) const blocks = node.getBlocksAtRange(range)
blocks.forEach((block) => { blocks.forEach((block) => {
if (properties.data) properties.data = Data.create(properties.data)
block = block.merge(properties) block = block.merge(properties)
node = node.updateDescendant(block) node = node.updateDescendant(block)
}) })