Skip to content

Commit 86c4f7e

Browse files
committed
fix: correctly index blocks that have children fixes #2115
1 parent 3e01080 commit 86c4f7e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/blocks/ListItem/NumberedListItem/IndexingPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ function getDecorations(
112112
);
113113

114114
if (existingDecorations.length === 0) {
115+
const blockNode = tr.doc.nodeAt(pos + 1);
115116
// Create a widget decoration to display the index
116117
decorationsToAdd.push(
117118
// move in by 1 to account for the block container
118-
Decoration.node(pos + 1, pos + node.nodeSize - 1, {
119+
Decoration.node(pos + 1, pos + 1 + blockNode!.nodeSize, {
119120
"data-index": index.toString(),
120121
}),
121122
);

0 commit comments

Comments
 (0)