From 650f4671266da600efa01754f1c1119e2ff61d93 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Tue, 16 Aug 2016 23:04:32 -0700 Subject: [PATCH] update setBlockAtRange() transform to use primitives --- lib/transforms/at-range.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/transforms/at-range.js b/lib/transforms/at-range.js index 43619f1fd..cd86507cf 100644 --- a/lib/transforms/at-range.js +++ b/lib/transforms/at-range.js @@ -613,19 +613,14 @@ export function removeMarkAtRange(transform, range, mark) { */ export function setBlockAtRange(transform, range, properties = {}) { - let { state } = transform - properties = Normalize.nodeProperties(properties) - let { document } = state + const { state } = transform + const { document } = state const blocks = document.getBlocksAtRange(range) blocks.forEach((block) => { - block = block.merge(properties) - document = document.updateDescendant(block) + transform.setNodeByKey(block.key, properties) }) - document = document.normalize() - state = state.merge({ document }) - transform.state = state return transform }