prosemirror-state
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -635,3 +635,3 @@ 'use strict'; | ||
if (inheritMarks !== false) | ||
{ node = node.mark(this.storedMarks || selection.$from.marks(selection.to > selection.from)); } | ||
{ node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to))); } | ||
selection.replaceWith(this, node); | ||
@@ -660,4 +660,8 @@ return this | ||
if (!text) { return this.deleteRange(from, to) } | ||
var node = schema.text(text, this.storedMarks || this.doc.resolve(from).marks(to > from)); | ||
return this.replaceRangeWith(from, to, node) | ||
var marks = this.storedMarks; | ||
if (!marks) { | ||
var $from = this.doc.resolve(from); | ||
marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to)); | ||
} | ||
return this.replaceRangeWith(from, to, schema.text(text, marks)) | ||
} | ||
@@ -664,0 +668,0 @@ }; |
{ | ||
"name": "prosemirror-state", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "ProseMirror editor state", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -136,3 +136,3 @@ import {Transform} from "prosemirror-transform" | ||
if (inheritMarks !== false) | ||
node = node.mark(this.storedMarks || selection.$from.marks(selection.to > selection.from)) | ||
node = node.mark(this.storedMarks || (selection.empty ? selection.$from.marks() : selection.$from.marksAcross(selection.$to))) | ||
selection.replaceWith(this, node) | ||
@@ -159,4 +159,8 @@ return this | ||
if (!text) return this.deleteRange(from, to) | ||
let node = schema.text(text, this.storedMarks || this.doc.resolve(from).marks(to > from)) | ||
return this.replaceRangeWith(from, to, node) | ||
let marks = this.storedMarks | ||
if (!marks) { | ||
let $from = this.doc.resolve(from) | ||
marks = to == from ? $from.marks() : $from.marksAcross(this.doc.resolve(to)) | ||
} | ||
return this.replaceRangeWith(from, to, schema.text(text, marks)) | ||
} | ||
@@ -163,0 +167,0 @@ } |
Sorry, the diff of this file is not supported yet
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
156282
1948