# Enforce empty trailing block

**URL:** <https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072>\
**Category:** Uncategorized\
**Created:** [July 9, 2019, 8:24am UTC](https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072 "2019-07-09T08:24:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![holtwick](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/holtwick/32/482_2.png) [@holtwick](https://discuss.prosemirror.net/u/holtwick)\
**Post date:** [July 9, 2019, 8:24am UTC](https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072/1 "2019-07-09T08:24:21Z")

</div>

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 `paragraph`.

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](https://github.com/scrumpy/tiptap/issues/143)

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 9, 2019, 9:27am UTC](https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072/2 "2019-07-09T09:27:42Z")

</div>

One solution to this is to enable the [gapcursor plugin](https://github.com/prosemirror/prosemirror-gapcursor), 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.

---

<div class="post-metadata">

**Author:** ![holtwick](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/holtwick/32/482_2.png) [@holtwick](https://discuss.prosemirror.net/u/holtwick)\
**Post date:** [July 9, 2019, 1:29pm UTC](https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072/3 "2019-07-09T13:29:47Z")

</div>

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](https://tiptap.scrumpy.io/title), 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 `appendTransaction`.

---

<div class="post-metadata">

**Author:** ![holtwick](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/holtwick/32/482_2.png) [@holtwick](https://discuss.prosemirror.net/u/holtwick)\
**Post date:** [July 23, 2019, 12:57pm UTC](https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072/4 "2019-07-23T12:57:18Z")

</div>

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:

- ReMirror: [https://github.com/ifiokjr/remirror/pull/110](https://github.com/ifiokjr/remirror/pull/110)
- TipTap: [https://github.com/scrumpy/tiptap/issues/143#issuecomment-514189149](https://github.com/scrumpy/tiptap/issues/143#issuecomment-514189149)
