With some schemes it might be possible to have block level elements like images, tables, embedded videos you name it, where it becomes difficult to add new text content after those elements.
For such situations it would be great to have a trailing empty line like a
Does anybody have an idea, what would be the smartest way to achive this?
Same problem here at TipTap: https://github.com/scrumpy/tiptap/issues/143
One solution to this is to enable the gapcursor plugin, which allows you to move your cursor below such an element and start typing. You could also write a plugin that uses
appendTransaction to make sure there’s an empty paragraph at such positions, but you’ll also have to do it between such nodes, and that solution always felt a bit crude to me.
Thanks @marijn for sharing those ideas.
appendTransaction is certainly a good entry point.
I also tried to add a special element to the
schema like TipTap did for the title element, but failed with it.
The natural place for such an extension might be, when the editor is on idle i.e. all structural changes have been applied and the editor is now waiting for new user input. I’ll take a look if I can achieve this using
I’d like to follow up with a solution that worked for me. The author of remirror came up with a nice solution for the problem: