prosemirror-transform
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -45,3 +45,3 @@ var ref = require("prosemirror-model"); | ||
// Replace the part of the document between `from` and `to` with the | ||
// part of the `source` between `start` and `end`. | ||
// given `slice`. | ||
Transform.prototype.replace = function(from, to, slice) { | ||
@@ -48,0 +48,0 @@ if ( to === void 0 ) to = from; |
@@ -137,4 +137,5 @@ var ref = require("prosemirror-model"); | ||
// Ensure all markup that isn't allowed in the new node type is cleared | ||
this$1.clearMarkupFor(this$1.mapping.map(pos, 1, mapFrom), type, attrs) | ||
var startM = this$1.mapping.map(pos, 1, mapFrom), endM = this$1.mapping.map(pos + node.nodeSize, 1, mapFrom) | ||
this$1.clearMarkupFor(this$1.mapping.slice(mapFrom).map(pos, 1), type, attrs) | ||
var mapping = this$1.mapping.slice(mapFrom) | ||
var startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1) | ||
this$1.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, | ||
@@ -141,0 +142,0 @@ new Slice(Fragment.from(type.create(attrs)), 0, 0), 1, true)) |
{ | ||
"name": "prosemirror-transform", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"description": "ProseMirror document transformations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -37,3 +37,3 @@ const {Fragment, Slice} = require("prosemirror-model") | ||
// Replace the part of the document between `from` and `to` with the | ||
// part of the `source` between `start` and `end`. | ||
// given `slice`. | ||
Transform.prototype.replace = function(from, to = from, slice = Slice.empty) { | ||
@@ -40,0 +40,0 @@ let step = replaceStep(this.doc, from, to, slice) |
@@ -121,4 +121,5 @@ const {Slice, Fragment} = require("prosemirror-model") | ||
// Ensure all markup that isn't allowed in the new node type is cleared | ||
this.clearMarkupFor(this.mapping.map(pos, 1, mapFrom), type, attrs) | ||
let startM = this.mapping.map(pos, 1, mapFrom), endM = this.mapping.map(pos + node.nodeSize, 1, mapFrom) | ||
this.clearMarkupFor(this.mapping.slice(mapFrom).map(pos, 1), type, attrs) | ||
let mapping = this.mapping.slice(mapFrom) | ||
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1) | ||
this.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, | ||
@@ -125,0 +126,0 @@ new Slice(Fragment.from(type.create(attrs)), 0, 0), 1, true)) |
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
2478
116538