prosemirror-model
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"name": "prosemirror-model", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -82,9 +82,9 @@ import {Fragment} from "./fragment" | ||
// :: (Fragment) → Slice | ||
// :: (Fragment, ?bool) → Slice | ||
// Create a slice from a fragment by taking the maximum possible | ||
// open value on both side of the fragment. | ||
static maxOpen(fragment) { | ||
static maxOpen(fragment, openIsolating=true) { | ||
let openStart = 0, openEnd = 0 | ||
for (let n = fragment.firstChild; n && !n.isLeaf; n = n.firstChild) openStart++ | ||
for (let n = fragment.lastChild; n && !n.isLeaf; n = n.lastChild) openEnd++ | ||
for (let n = fragment.firstChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.firstChild) openStart++ | ||
for (let n = fragment.lastChild; n && !n.isLeaf && (openIsolating || !n.type.spec.isolating); n = n.lastChild) openEnd++ | ||
return new Slice(fragment, openStart, openEnd) | ||
@@ -91,0 +91,0 @@ } |
@@ -152,3 +152,3 @@ import {Mark} from "./mark" | ||
// :: () → ?[Mark] | ||
// :: (ResolvedPos) → ?[Mark] | ||
// Get the marks after the current position, if any, except those | ||
@@ -155,0 +155,0 @@ // that are non-inclusive and not present at position `$end`. This |
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
460143
5781