Feature Request: Make node skipping configurable in Table of Contents #7164
AndrewIngram
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In the table of contents extension, anchor nodes are skipped if they don't have any text content:
https://github.com/ueberdosis/tiptap/blob/develop/packages/extension-table-of-contents/src/plugin.ts#L25-L27
For the one of the node types I'm using, the label isn't part of the textContent, but rather stored in an additional attribute -- but this means that until I add some actual content, the node is missing from the outline -- even if it has an appropriate label.
If it were possible to pass in a callback that's used instead of the textContent check (it'd default to the same logic), i'd be able to work around this limitation.
Use Case
I have custom node times that I want to appear in the outline regardless of whether they have any content or not.
Type
New feature
Beta Was this translation helpful? Give feedback.
All reactions