prosemirror-transform 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.es.js +8 -10
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/replace.js +8 -10
package/package.json
CHANGED
package/src/replace.js
CHANGED
|
@@ -390,16 +390,14 @@ Transform.prototype.replaceRange = function(from, to, slice) {
|
|
|
390
390
|
if (i == slice.openStart) break
|
|
391
391
|
content = node.content
|
|
392
392
|
}
|
|
393
|
-
|
|
394
|
-
//
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
$from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 2].type)
|
|
402
|
-
preferredDepth -= 2
|
|
393
|
+
|
|
394
|
+
// Back up preferredDepth to cover defining textblocks directly
|
|
395
|
+
// above it, possibly skipping a non-defining textblock.
|
|
396
|
+
for (let d = preferredDepth - 1; d >= 0; d--) {
|
|
397
|
+
let type = leftNodes[d].type, def = definesContent(type)
|
|
398
|
+
if (def && $from.node(preferredTargetIndex).type != type) preferredDepth = d
|
|
399
|
+
else if (def || !type.isTextblock) break
|
|
400
|
+
}
|
|
403
401
|
|
|
404
402
|
for (let j = slice.openStart; j >= 0; j--) {
|
|
405
403
|
let openDepth = (j + preferredDepth + 1) % (slice.openStart + 1)
|