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
Alongside custom block types, custom InlineContent types would allow for more extensibility within BlockNote. This would allow consumers to implement features like comments and spellcheck.
It would also be worth considering custom marks/styles while working on this issue.
Reacted by J, JJ. Ramirez, Arun, Edward Curran and Nacho Villanueva
We're currently working on fixing the clipboard & HTML/Markdown conversion, so go ahead! I would start by taking a look at the custom blocks API (block.ts for vanilla, ReactBlockSpec.ts for React) and doing something similar for marks/inline nodes, i.e. converting to the TipTap API, storing a schema, typing, etc.
It seems to work fine. Though my use case was dragging and dropping these nodes from somewhere else into the text. I'm wondering if it's worth adding this as an example somewhere for the time being?
Oh awesome! I guess there are still probably some quirks when converting the node to InlineContent[] or converting to HTML, but good to see that it's not too much hassle to get it working. I think for now it's ok if ppl just get linked to this issue if they ask about custom inline nodes in discord, and make a documentation page once we can make custom inline content types using the BlockNote API rather than using TipTap's.
Activity
man-shar commentedon Nov 1, 2023
Is this something that's being worked on actively already? If not, I'd love to try and implement the custom marks support.
matthewlipski commentedon Nov 5, 2023
We're currently working on fixing the clipboard & HTML/Markdown conversion, so go ahead! I would start by taking a look at the custom blocks API (
block.tsfor vanilla,ReactBlockSpec.tsfor React) and doing something similar for marks/inline nodes, i.e. converting to the TipTap API, storing a schema, typing, etc.man-shar commentedon Nov 6, 2023
Great, thanks! Last week, I did end up implementing this as a new Tiptap node like so:
It seems to work fine. Though my use case was dragging and dropping these nodes from somewhere else into the text. I'm wondering if it's worth adding this as an example somewhere for the time being?
matthewlipski commentedon Nov 7, 2023
Oh awesome! I guess there are still probably some quirks when converting the node to
InlineContent[]or converting to HTML, but good to see that it's not too much hassle to get it working. I think for now it's ok if ppl just get linked to this issue if they ask about custom inline nodes in discord, and make a documentation page once we can make custom inline content types using the BlockNote API rather than using TipTap's.