jellypbc / poster

Jelly demo toy app that turns PDFs into editable posts
https://jellypbc.com
Other
22 stars 3 forks source link

Code Block prevents creation of new lines #194

Open yash-dani opened 4 years ago

yash-dani commented 4 years ago

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

cindywu commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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