(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 <c.gromoff@gmail.com>
This commit is contained in:
Cyril
2025-10-01 09:18:29 +02:00
parent 5184723862
commit 431c331154
2 changed files with 7 additions and 1 deletions

View File

@@ -29,7 +29,12 @@ export const useHeadingStore = create<UseHeadingStore>((set, get) => ({
headings: [],
setHeadings: (editor) => {
const headingBlocks = editor?.document
.filter((block) => block.type === 'heading')
.filter(
(block) =>
block.type === 'heading' &&
block.props.level >= 1 &&
block.props.level <= 3,
)
.map((block) => ({
...block,
contentText: recursiveTextContent(