Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-transform

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-transform - npm Package Compare versions

Comparing version 0.21.0 to 0.21.1

22

dist/mark.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc