Skip to content

Commit

Permalink
Revert "fix a bug for getting mark range, fix #156"
Browse files Browse the repository at this point in the history
This reverts commit 0cf905a.
  • Loading branch information
mariux committed May 3, 2019
1 parent 392f8a2 commit d057d5d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/tiptap-utils/src/utils/getMarkRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ export default function ($pos = null, type = null) {
startPos -= $pos.parent.child(startIndex).nodeSize
}

const endIndex = $pos.indexAfter()
const endPos = startPos + start.node.nodeSize

// disable for now. see #156
// while (endIndex < $pos.parent.childCount && link.isInSet($pos.parent.child(endIndex).marks)) {
// endPos += $pos.parent.child(endIndex).nodeSize
// endIndex += 1
// }
let endIndex = $pos.indexAfter()
let endPos = startPos + start.node.nodeSize
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 }

Expand Down

0 comments on commit d057d5d

Please sign in to comment.