patleeman / quill-markdown-shortcuts

Quill.js module that converts markdown to rich text formatting while typing.
https://patleeman.github.io/quill-markdown-shortcuts/
140 stars 49 forks source link

Demo: Fenced code block as the last element is impossible to get past in the document #9

Closed aral closed 6 years ago

aral commented 6 years ago

If the last element in your document is a fenced code block, there seems to be no way to get past it. For example, to create a paragraph after it.

The way Typora handles this (which feels intuitive) is to have a line after the fenced code block that you can navigate to using the down arrow key. (For completeness, the first time you press the down arrow key Typora shows a language chooser for syntax highlighting and the next time you press the down arrow key, you navigate past the fenced code block to a new line. Although that’s not a feature here, of course.)

PS. Awesome module, by the way. Thank you for making and sharing it :)

aral commented 6 years ago

I just stumbled on how it’s supposed to work: pressing return three times at the end.

I only found because I was trying to put some empty lines in it to test. I don’t think I would have intuitively figured it out.

I still feel “down arrow at bottom to exit code fence” is more intuitive.

patleeman commented 6 years ago

Hey @aral

I've noticed this as well. I think this is more of an issue with Quill than this module. This module doesn't dictate how the behavior works inside the editor, just uses the built in methods and formats. The only format I do add is the horizontal rule. I agree, a down arrow would be much friendlier.

Perhaps open an issue in the Quill core repo? I unfortunately can't help too much here.

aral commented 6 years ago

Adam just wrote up a very comprehensive response on the Quill forum about how they worked around this issue. Drawing attention to it here for future reference:

https://github.com/quilljs/quill/issues/1978#issuecomment-369129064