Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/notion-types/src/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ export interface BulletedListBlock extends BaseTextBlock {

export interface NumberedListBlock extends BaseTextBlock {
type: 'numbered_list'
format?: BaseTextBlock['format'] & {
list_start_index?: number
}
}

export interface HeaderBlock extends BaseTextBlock {
Expand Down
6 changes: 5 additions & 1 deletion packages/react-notion-x/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ export const getListNumber = (blockId: string, blockMap: BlockMap) => {
return
}

return group.indexOf(blockId) + 1
const groupIndex = group.indexOf(blockId) + 1
const startIndex = blockMap[blockId]?.value.format?.list_start_index
return blockMap[blockId]?.value.type === 'numbered_list'
? (startIndex ?? groupIndex)
: groupIndex
}

export const getListNestingLevel = (
Expand Down