fix a bug for getting mark range, fix #156

This commit is contained in:
Philipp Kühn
2019-01-19 09:29:15 +01:00
parent 1e9b862920
commit 0cf905abb9

View File

@@ -22,12 +22,14 @@ export default function ($pos = null, type = null) {
startPos -= $pos.parent.child(startIndex).nodeSize startPos -= $pos.parent.child(startIndex).nodeSize
} }
let endIndex = $pos.indexAfter() const endIndex = $pos.indexAfter()
let endPos = startPos + start.node.nodeSize const endPos = startPos + start.node.nodeSize
while (endIndex < $pos.parent.childCount && link.isInSet($pos.parent.child(endIndex).marks)) {
endPos += $pos.parent.child(endIndex).nodeSize // disable for now. see #156
endIndex += 1 // while (endIndex < $pos.parent.childCount && link.isInSet($pos.parent.child(endIndex).marks)) {
} // endPos += $pos.parent.child(endIndex).nodeSize
// endIndex += 1
// }
return { from: startPos, to: endPos } return { from: startPos, to: endPos }