prosemirror-transform
Advanced tools
Comparing version 0.21.0 to 0.21.1
@@ -23,16 +23,16 @@ var ref = require("prosemirror-model"); | ||
var marks = node.marks | ||
if (mark.isInSet(marks) || !parent.contentMatchAt(index + 1).allowsMark(mark.type)) { | ||
adding = removing = null | ||
} else { | ||
if (!mark.isInSet(marks) && parent.contentMatchAt(index + 1).allowsMark(mark.type)) { | ||
var start = Math.max(pos, from), end = Math.min(pos + node.nodeSize, to) | ||
var rm = mark.type.isInSet(marks) | ||
var newSet = mark.addToSet(marks) | ||
if (!rm) | ||
{ removing = null } | ||
else if (removing && removing.mark.eq(rm)) | ||
{ removing.to = end } | ||
else | ||
{ removed.push(removing = new RemoveMarkStep(start, end, rm)) } | ||
for (var i = 0; i < marks.length; i++) { | ||
if (!marks[i].isInSet(newSet)) { | ||
if (removing && removing.to == start && removing.mark.eq(marks[i])) | ||
{ removing.to = end } | ||
else | ||
{ removed.push(removing = new RemoveMarkStep(start, end, marks[i])) } | ||
} | ||
} | ||
if (adding) | ||
if (adding && adding.to == start) | ||
{ adding.to = end } | ||
@@ -39,0 +39,0 @@ else |
@@ -136,3 +136,5 @@ var ref = require("prosemirror-model"); | ||
if (start < $from.pos - ($from.depth - d) || | ||
$to.end(d) > $to.pos + ($to.depth - d)) { break } | ||
$to.end(d) > $to.pos + ($to.depth - d) || | ||
$from.node(d).type.spec.isolating || | ||
$to.node(d).type.spec.isolating) { break } | ||
if (start == $to.start(d)) { result.push(d) } | ||
@@ -139,0 +141,0 @@ } |
{ | ||
"name": "prosemirror-transform", | ||
"version": "0.21.0", | ||
"version": "0.21.1", | ||
"description": "ProseMirror document transformations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -14,16 +14,16 @@ const {MarkType, Slice, Fragment} = require("prosemirror-model") | ||
let marks = node.marks | ||
if (mark.isInSet(marks) || !parent.contentMatchAt(index + 1).allowsMark(mark.type)) { | ||
adding = removing = null | ||
} else { | ||
if (!mark.isInSet(marks) && parent.contentMatchAt(index + 1).allowsMark(mark.type)) { | ||
let start = Math.max(pos, from), end = Math.min(pos + node.nodeSize, to) | ||
let rm = mark.type.isInSet(marks) | ||
let newSet = mark.addToSet(marks) | ||
if (!rm) | ||
removing = null | ||
else if (removing && removing.mark.eq(rm)) | ||
removing.to = end | ||
else | ||
removed.push(removing = new RemoveMarkStep(start, end, rm)) | ||
for (let i = 0; i < marks.length; i++) { | ||
if (!marks[i].isInSet(newSet)) { | ||
if (removing && removing.to == start && removing.mark.eq(marks[i])) | ||
removing.to = end | ||
else | ||
removed.push(removing = new RemoveMarkStep(start, end, marks[i])) | ||
} | ||
} | ||
if (adding) | ||
if (adding && adding.to == start) | ||
adding.to = end | ||
@@ -30,0 +30,0 @@ else |
@@ -128,3 +128,5 @@ const {Fragment, Slice} = require("prosemirror-model") | ||
if (start < $from.pos - ($from.depth - d) || | ||
$to.end(d) > $to.pos + ($to.depth - d)) break | ||
$to.end(d) > $to.pos + ($to.depth - d) || | ||
$from.node(d).type.spec.isolating || | ||
$to.node(d).type.spec.isolating) break | ||
if (start == $to.start(d)) result.push(d) | ||
@@ -131,0 +133,0 @@ } |
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
136405
2904
2