Skip to content

getBlockInfoFromPos is still buggy in 0.8.5 #300

@sradu

Description

@sradu

Describe the bug
I was incredibly excited about the menus refactor and I decided to play around with it today.

Would like to apologize for not being able to provide a proper sandbox, but I think the bug is easy to show.

getBlockInfoFromPos() is called by nodeToBlock() which is called with arbitrary nodes.

//console.log() messages:

outerBlockGroupEndPos 1
in pos <= outerBlockGroupStartPos
pos is 2
doc nodeSize 3
Uncaught RangeError: Position 2 out of range
    at ResolvedPos.resolve
    at ResolvedPos.resolveCached

0.8.5 resolved collaboration (was struggling with that too), but it broke some of this other functionality. The confusion was likely caused by the fact that getBlockInfoFromPos()'s param is called doc and not node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingprio:highHigh priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions