✨(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:
@@ -38,6 +38,7 @@ and this project adheres to
|
||||
- 🐛(frontend) fix legacy role computation #1376
|
||||
- 🛂(frontend) block editing title when not allowed #1412
|
||||
- 🐛(frontend) scroll back to top when navigate to a document #1406
|
||||
- 🐛(frontend) exclude h4-h6 headings from table of contents #1441
|
||||
- 🔒(frontend) prevent readers from changing callout emoji #1449
|
||||
|
||||
## [3.7.0] - 2025-09-12
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user