Socket
Socket
Sign inDemoInstall

@technik-sde/prosemirror-recreate-transform

Package Overview
Dependencies
Maintainers
38
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@technik-sde/prosemirror-recreate-transform - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

2

package.json
{
"name": "@technik-sde/prosemirror-recreate-transform",
"version": "1.0.1",
"version": "1.1.0",
"description": "Create a set of steps transforming one prosemirror json document to another",

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

@@ -151,3 +151,14 @@ import { Transform } from "prosemirror-transform";

const nodeType = fromNode.type === toNode.type ? null : toNode.type;
this.tr.setNodeMarkup(start, nodeType, toNode.attrs, toNode.marks);
try {
this.tr.setNodeMarkup(start, nodeType, toNode.attrs, toNode.marks);
} catch (e) {
// if nodetypes differ, the updated node-type and contents might not be compatible
// with schema and requires a replace
if (nodeType && e.message.includes("Invalid content")) {
// @todo add test-case for this scenario
this.tr.replaceWith(start, start + fromNode.nodeSize, toNode);
} else {
throw e;
}
}
this.currentJSON = removeMarks(this.tr.doc).toJSON();

@@ -154,0 +165,0 @@ // setting the node markup may have invalidated the following ops, so we calculate them again.

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