You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Our current usage for BlockNote is to edit and render Markdown (GFM) documents. As GMT doesn't natively support togglable elements (and we don't support HTML), we'd like to remove the support for togglable elements.
For togglable list items, it's easy: we just pick them out of the schema. But for togglable headers, it's more complicated.
Describe the solution you'd like
Add an option (in the schema maybe? or in the editor's options?) to disable the ability to create togglable headings, etc.
Describe alternatives you've considered
N/A
Additional context
N/A
Bonus
[ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖
The only way to create toggle headings by default is via the slash menu, so the recommended way to remove toggle heading support is to filter out the toggle heading from the slash menu similar to this example:
In the future, we will probably have configuration at the schema level for this, but at the moment we do not have an API which allows this sort of configuration.
The only way to create toggle headings by default is via the slash menu, so the recommended way to remove toggle heading support is to filter out the toggle heading from the slash menu similar to this example:
Lines 77 to 84 in 0ad2da6
getItems={async (query) =>
filterSuggestionItems(
getDefaultReactSlashMenuItems(editor).filter(
(item) => item.title !== "Emoji",
),
query,
)
}
This works but is really an ugly way of doing this IMO, more akin to a "hack" than anything else.
We are filtering on the title of the elements instead of their behavior, so I'm not very fond of this approach.
But sure, it works for now, I'll use it for the time being, but I think an editor option or a schema option would definitely be the best approach.
Hi, I was wondering if this issue should be re-opened? Having a dirty way to do it (which requires manually filtering elements and heavily customizing the toolbar) is not a good solution IMO, so it would be nice to have this issue open until the feature is ready in BlockNote (even if it's not a priority right now) :)
Activity
YousefED commentedon Jul 7, 2025
@nperez0111 @matthewlipski I think we discussed this the other day. What's the recommended approach for this atm?
nperez0111 commentedon Jul 8, 2025
The only way to create toggle headings by default is via the slash menu, so the recommended way to remove toggle heading support is to filter out the toggle heading from the slash menu similar to this example:
BlockNote/examples/03-ui-components/13-custom-ui/App.tsx
Lines 77 to 84 in 0ad2da6
nperez0111 commentedon Jul 8, 2025
In the future, we will probably have configuration at the schema level for this, but at the moment we do not have an API which allows this sort of configuration.
ClementEXWiki commentedon Jul 8, 2025
This works but is really an ugly way of doing this IMO, more akin to a "hack" than anything else.
We are filtering on the title of the elements instead of their behavior, so I'm not very fond of this approach.
But sure, it works for now, I'll use it for the time being, but I think an editor option or a schema option would definitely be the best approach.
nperez0111 commentedon Jul 9, 2025
Yep, not a great way to do it. We will fix this eventually
MetaMmodern commentedon Jul 23, 2025
@nperez0111 continuing here: but slash menu is not the only place where you could access toggleable headings.
Here they are in the Formatting Toolbar as well
So you're saying for now only way to hide them is to customize both SlashMenu and FormattingToolbar individually?
nperez0111 commentedon Jul 23, 2025
Yes, right now that'd be the only way to do it.
ClementEXWiki commentedon Feb 12, 2026
Hi, I was wondering if this issue should be re-opened? Having a dirty way to do it (which requires manually filtering elements and heavily customizing the toolbar) is not a good solution IMO, so it would be nice to have this issue open until the feature is ready in BlockNote (even if it's not a priority right now) :)