prosemirror-transform
Advanced tools
Comparing version 1.3.3 to 1.3.4
@@ -0,1 +1,7 @@ | ||
## 1.3.4 (2022-02-04) | ||
### Bug fixes | ||
Make sure that constructing an empty `StepMap` returns `StepMap.empty`. | ||
## 1.3.3 (2021-09-29) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-transform", | ||
"version": "1.3.3", | ||
"version": "1.3.4", | ||
"description": "ProseMirror document transformations", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"mocha": "^3.0.2", | ||
"mocha": "^9.1.2", | ||
"ist": "^1.0.0", | ||
@@ -26,0 +26,0 @@ "prosemirror-test-builder": "^1.0.0", |
@@ -60,2 +60,3 @@ // Mappable:: interface | ||
constructor(ranges, inverted = false) { | ||
if (!ranges.length && StepMap.empty) return StepMap.empty | ||
this.ranges = ranges | ||
@@ -62,0 +63,0 @@ this.inverted = inverted |
@@ -106,4 +106,10 @@ import {Slice, Fragment} from "prosemirror-model" | ||
let content = Fragment.empty | ||
for (let i = wrappers.length - 1; i >= 0; i--) | ||
for (let i = wrappers.length - 1; i >= 0; i--) { | ||
if (content.size) { | ||
let match = wrappers[i].type.contentMatch.matchFragment(content) | ||
if (!match || !match.validEnd) | ||
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper") | ||
} | ||
content = Fragment.from(wrappers[i].type.create(wrappers[i].attrs, content)) | ||
} | ||
@@ -110,0 +116,0 @@ let start = range.start, end = range.end |
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
497869
4514