Skip to content

Commit 431c331

Browse files
committed
✨(frontend) exclude h4-h6 headings from table of contents
filters out h4-h6 so they no longer appear in the document outline Signed-off-by: Cyril <[email protected]>
1 parent 5184723 commit 431c331

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ and this project adheres to
3838
- 🐛(frontend) fix legacy role computation #1376
3939
- 🛂(frontend) block editing title when not allowed #1412
4040
- 🐛(frontend) scroll back to top when navigate to a document #1406
41+
- 🐛(frontend) exclude h4-h6 headings from table of contents #1441
4142
- 🔒(frontend) prevent readers from changing callout emoji #1449
4243

4344
## [3.7.0] - 2025-09-12

src/frontend/apps/impress/src/features/docs/doc-editor/stores/useHeadingStore.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ export const useHeadingStore = create<UseHeadingStore>((set, get) => ({
2929
headings: [],
3030
setHeadings: (editor) => {
3131
const headingBlocks = editor?.document
32-
.filter((block) => block.type === 'heading')
32+
.filter(
33+
(block) =>
34+
block.type === 'heading' &&
35+
block.props.level >= 1 &&
36+
block.props.level <= 3,
37+
)
3338
.map((block) => ({
3439
...block,
3540
contentText: recursiveTextContent(

0 commit comments

Comments
 (0)