prosemirror-view
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "prosemirror-view", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "ProseMirror's view component", | ||
@@ -20,3 +20,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"prosemirror-model": "^1.0.0", | ||
"prosemirror-model": "^1.1.0", | ||
"prosemirror-state": "^1.0.0", | ||
@@ -23,0 +23,0 @@ "prosemirror-transform": "^1.0.0" |
@@ -72,3 +72,3 @@ import {Slice, Fragment, DOMParser, DOMSerializer} from "prosemirror-model" | ||
else // HTML wasn't created by ProseMirror. Make sure top-level siblings are coherent | ||
slice = normalizeSiblings(slice, $context) | ||
slice = Slice.maxOpen(normalizeSiblings(slice.content, $context), false) | ||
view.someProp("transformPasted", f => { slice = f(slice) }) | ||
@@ -86,4 +86,4 @@ return slice | ||
// fit anywhere in the schema. | ||
function normalizeSiblings(slice, $context) { | ||
if (slice.content.childCount < 2) return slice | ||
function normalizeSiblings(fragment, $context) { | ||
if (fragment.childCount < 2) return fragment | ||
for (let d = $context.depth; d >= 0; d--) { | ||
@@ -93,3 +93,3 @@ let parent = $context.node(d) | ||
let lastWrap, result = [] | ||
slice.content.forEach(node => { | ||
fragment.forEach(node => { | ||
if (!result) return | ||
@@ -108,5 +108,5 @@ let wrap = match.findWrapping(node.type), inLast | ||
}) | ||
if (result) return Slice.maxOpen(Fragment.from(result)) | ||
if (result) return Fragment.from(result) | ||
} | ||
return slice | ||
return fragment | ||
} | ||
@@ -113,0 +113,0 @@ |
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
685070
Updatedprosemirror-model@^1.1.0