prosemirror-model
Advanced tools
Comparing version 1.13.0 to 1.13.1
@@ -0,1 +1,7 @@ | ||
## 1.13.1 (2020-12-20) | ||
### Bug fixes | ||
Fix a bug where nested marks of the same type would be applied to the wrong node when parsing from DOM. | ||
## 1.13.0 (2020-12-11) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-model", | ||
"version": "1.13.0", | ||
"version": "1.13.1", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -170,3 +170,3 @@ import {Fragment} from "./fragment" | ||
if (this.tokens[this.tokens.length - 1] == "") this.tokens.pop() | ||
if (this.tokens[0] == "") this.tokens.unshift() | ||
if (this.tokens[0] == "") this.tokens.shift() | ||
} | ||
@@ -173,0 +173,0 @@ |
@@ -348,5 +348,5 @@ import {Fragment} from "./fragment" | ||
popFromStashMark(markType) { | ||
popFromStashMark(mark) { | ||
for (let i = this.stashMarks.length - 1; i >= 0; i--) | ||
if (this.stashMarks[i].type == markType) return this.stashMarks.splice(i, 1)[0] | ||
if (mark.eq(this.stashMarks[i])) return this.stashMarks.splice(i, 1)[0] | ||
} | ||
@@ -359,4 +359,2 @@ | ||
!mark.isInSet(this.activeMarks)) { | ||
let found = findSameTypeInSet(mark, this.activeMarks) | ||
if (found) this.stashMarks.push(found) | ||
this.activeMarks = mark.addToSet(this.activeMarks) | ||
@@ -726,3 +724,3 @@ this.pendingMarks = mark.removeFromSet(this.pendingMarks) | ||
addPendingMark(mark) { | ||
let found = findSameTypeInSet(mark, this.top.pendingMarks) | ||
let found = findSameMarkInSet(mark, this.top.pendingMarks) | ||
if (found) this.top.stashMarks.push(found) | ||
@@ -740,3 +738,3 @@ this.top.pendingMarks = mark.addToSet(this.top.pendingMarks) | ||
level.activeMarks = mark.removeFromSet(level.activeMarks) | ||
let stashMark = level.popFromStashMark(mark.type) | ||
let stashMark = level.popFromStashMark(mark) | ||
if (stashMark) level.activeMarks = stashMark.addToSet(level.activeMarks) | ||
@@ -805,6 +803,6 @@ } | ||
function findSameTypeInSet(mark, set) { | ||
function findSameMarkInSet(mark, set) { | ||
for (let i = 0; i < set.length; i++) { | ||
if (mark.type == set[i].type) return set[i] | ||
if (mark.eq(set[i])) return set[i] | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
890957
9168