prosemirror-transform
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,7 @@ | ||
## 1.4.1 (2022-03-31) | ||
### Bug fixes | ||
`replaceRange` will now close multiple defining parent nodes when appropriate. | ||
## 1.4.0 (2022-03-21) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-transform", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "ProseMirror document transformations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -393,13 +393,11 @@ import {Fragment, Slice} from "prosemirror-model" | ||
} | ||
// Back up if the node directly above openStart, or the node above | ||
// that separated only by a non-defining textblock node, is defining. | ||
if (preferredDepth > 0 && definesContent(leftNodes[preferredDepth - 1].type) && | ||
$from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 1].type) | ||
preferredDepth -= 1 | ||
else if (preferredDepth >= 2 && | ||
leftNodes[preferredDepth - 1].isTextblock && | ||
definesContent(leftNodes[preferredDepth - 2].type) && | ||
$from.node(preferredTargetIndex).type != leftNodes[preferredDepth - 2].type) | ||
preferredDepth -= 2 | ||
// Back up preferredDepth to cover defining textblocks directly | ||
// above it, possibly skipping a non-defining textblock. | ||
for (let d = preferredDepth - 1; d >= 0; d--) { | ||
let type = leftNodes[d].type, def = definesContent(type) | ||
if (def && $from.node(preferredTargetIndex).type != type) preferredDepth = d | ||
else if (def || !type.isTextblock) break | ||
} | ||
for (let j = slice.openStart; j >= 0; j--) { | ||
@@ -406,0 +404,0 @@ let openDepth = (j + preferredDepth + 1) % (slice.openStart + 1) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
498342
4526