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/dist/index.js
CHANGED
|
@@ -1597,16 +1597,14 @@ Transform.prototype.replaceRange = function(from, to, slice) {
|
|
|
1597
1597
|
if (i == slice.openStart) { break }
|
|
1598
1598
|
content = node.content;
|
|
1599
1599
|
}
|
|
1600
|
-
|
|
1601
|
-
//
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
$from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 2].type)
|
|
1609
|
-
{ preferredDepth -= 2; }
|
|
1600
|
+
|
|
1601
|
+
// Back up preferredDepth to cover defining textblocks directly
|
|
1602
|
+
// above it, possibly skipping a non-defining textblock.
|
|
1603
|
+
for (var d$1 = preferredDepth - 1; d$1 >= 0; d$1--) {
|
|
1604
|
+
var type = leftNodes[d$1].type, def = definesContent(type);
|
|
1605
|
+
if (def && $from.node(preferredTargetIndex).type != type) { preferredDepth = d$1; }
|
|
1606
|
+
else if (def || !type.isTextblock) { break }
|
|
1607
|
+
}
|
|
1610
1608
|
|
|
1611
1609
|
for (var j = slice.openStart; j >= 0; j--) {
|
|
1612
1610
|
var openDepth = (j + preferredDepth + 1) % (slice.openStart + 1);
|