poster icon indicating copy to clipboard operation
poster copied to clipboard

Code Block prevents creation of new lines

Open yash-dani opened this issue 5 years ago • 3 comments

Describe the bug If the last line in the writer is a block of code, you cannot add new lines of text to the document. Typing enter creates a newline in the code block itself, and clicking underneath the block of code does not create a newline.

Expected behavior Should be able to create a new line underneath the code block.

Screenshots Issue Preview

yash-dani avatar May 10 '20 20:05 yash-dani

Should be able to create a new line underneath the code block.

shift+enter creates a new line of text... the problem is users won't know that unless they already know about shift+enter :(

i am not sure what the right ux is here, but jelly's current ux clearly is not working for the user

if you're working on this just go with your gut and try something that you think works best!

cindywu avatar Jun 27 '20 23:06 cindywu

one solution is to add a trailing node to the end of every post

if the last editor node is not a paragraph for a heading, add an additional paragraph node

see plugins/trailingnode.ts as an example https://github.com/outline/rich-markdown-editor

cindywu avatar Jul 04 '20 23:07 cindywu

https://discuss.prosemirror.net/t/enforce-empty-trailing-block/2072 https://github.com/remirror/remirror/pull/110

cindywu avatar Jul 04 '20 23:07 cindywu