Text: When a code block is the last thing in a document, then you can't insert text after it

Created on 27 Jun 2019  路  4Comments  路  Source: nextcloud/text

Describe the bug
When a code block is the last thing in a document, then you can't insert text after it (at least I can't figure out how to :)).

To Reproduce
Steps to reproduce the behavior:

  1. Go to the last line of the document
  2. Insert a code block and enter some text in it
  3. Attempt to insert a new line of text after the code block

Expected behavior
I would expect the same behavior as inserting images, where a newline is inserted after the image or the ability to double click after the last line to create a new.

Client details:

  • OS: Windows
  • Browser: Firefox
  • Nextcloud version: 16.0.1
1. to develop bug good first issue upstream

Most helpful comment

You can press "Shift-Enter" to get out of the code block, but I agree that it should be possible to move outside of the block by hitting enter two times probably. cc @nextcloud/designers

All 4 comments

You can press "Shift-Enter" to get out of the code block, but I agree that it should be possible to move outside of the block by hitting enter two times probably. cc @nextcloud/designers

Yes, agree this is an issue, tiptap seems to have the same problem. So I would say this is something to fix upstream? I couldn鈥檛 find an issue for it at https://github.com/scrumpy/tiptap/issues

Hitting enter two times would then make you unable to write longer code in it though? Maybe there should always be an empty line after a code block?

Should be something we can fix with the new TrailingNode extension.

https://github.com/scrumpy/tiptap/issues/143#issuecomment-514319700

In Dropbox Paper, you need hit enter twice on an empty line to escape the code block. I like this, because it still lets you insert blank lines into the code block while also giving you a quick way out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

doobry-systemli picture doobry-systemli  路  3Comments

jeyca picture jeyca  路  5Comments

juliushaertl picture juliushaertl  路  5Comments

Klakla2 picture Klakla2  路  5Comments

jancborchardt picture jancborchardt  路  6Comments