Skip to content

BlockSuite API Documentation / @blocksuite/affine-block-list / correctNumberedListsOrderToPrev

Function: correctNumberedListsOrderToPrev()

correctNumberedListsOrderToPrev(doc, modelOrId, transact): void

Defined in: packages/affine/blocks/block-list/src/commands/utils.ts:14

correct target is a numbered list, which is divided into two steps:

  1. check if there is a numbered list before the target list. If so, adjust the order of the target list to the order of the previous list plus 1, otherwise set the order to 1
  2. find continuous lists starting from the target list and keep their order continuous

Parameters

doc

Store

modelOrId

string | BlockModel<object>

transact

boolean = true

Returns

void