Skip to content

How to get the index of the block in plugin? #1752

@carbonrider

Description

@carbonrider

Question
How to get the index of the block in plugin?

Context

I am using Editor JS to implement a custom editor. Based on some logic, I highlight a block matching to criteria. While doing this, I realised that there is no way to know the index of the block. Note that the block is not selected or focused. Is there any way to get index of the block in the plugin. I see there are various methods like getblockbyindex, getblockscount etc, but there is no method for getBlockIndex(block).

Comments

The BlockManager has a method to get the block index, but it is not exposed to plugin via blocks API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions