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 1.1.2 to 1.1.3

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.1.3 (2018-07-03)
### Bug fixes
Replacing from a code block into a paragraph that has marks, or similar scenarios that would join content with the wrong marks into a node, no longer crashes.
## 1.1.2 (2018-06-29)

@@ -2,0 +8,0 @@

2

package.json
{
"name": "prosemirror-transform",
"version": "1.1.2",
"version": "1.1.3",
"description": "ProseMirror document transformations",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -90,8 +90,9 @@ import {Fragment, Slice} from "prosemirror-model"

let match, count = content.childCount, matchCount = count - (openEnd > 0 ? 1 : 0)
let parentNode = openStart < 0 ? parent : $from.node(depth)
if (openStart < 0)
match = parent.contentMatchAt(matchCount)
match = parentNode.contentMatchAt(matchCount)
else if (count == 1 && openEnd > 0)
match = $from.node(depth).contentMatchAt(openStart ? $from.index(depth) : $from.indexAfter(depth))
match = parentNode.contentMatchAt(openStart ? $from.index(depth) : $from.indexAfter(depth))
else
match = $from.node(depth).contentMatchAt($from.indexAfter(depth))
match = parentNode.contentMatchAt($from.indexAfter(depth))
.matchFragment(content, count > 0 && openStart ? 1 : 0, matchCount)

@@ -126,2 +127,4 @@

let joinable = match.fillBefore(toNode.content, true, toIndex)
for (let i = toIndex; joinable && i < toNode.content.childCount; i++)
if (!parentNode.type.allowsMarks(toNode.content.child(i).marks)) joinable = null
if (!joinable) return null

@@ -188,13 +191,13 @@

let parent = slice.openEnd ? nodeRight(slice.content, slice.openEnd)
: $from.node($from.depth - (slice.openStart - slice.openEnd))
if (!parent.isTextblock) return false
for (let i = $to.index(); i < $to.parent.childCount; i++)
if (!parent.type.allowsMarks($to.parent.child(i).marks)) return false
let match
if (!slice.openEnd) {
let parent = $from.node($from.depth - (slice.openStart - slice.openEnd))
if (!parent.isTextblock) return false
if (slice.openEnd) {
match = parent.contentMatchAt(parent.childCount)
if (slice.size)
match = match.matchFragment(slice.content, slice.openStart ? 1 : 0)
} else {
let parent = nodeRight(slice.content, slice.openEnd)
if (!parent.isTextblock) return false
match = parent.contentMatchAt(parent.childCount)
if (slice.size) match = match.matchFragment(slice.content, slice.openStart ? 1 : 0)
}

@@ -201,0 +204,0 @@ match = match.matchFragment($to.parent.content, $to.index())

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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