typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

Visual editor always adds new paragraph on "save" #261

Closed thenktor closed 3 months ago

thenktor commented 2 years ago

Hi,

the visual editor always opens a new paragraph input box after clicking "save". This is nice as long as I really want to add a new paragraph, but more often it happens that I want to add something else (headline, image, cite...) after the paragraph.

Then it's quite annoying that I first have to hit "cancel" to show the toolbar again so that I can add another thing.

IMHO there is a better solution needed. Not sure how, but maybe some solution with showing the toolbar and the input box together.

trendschau commented 2 years ago

I have to think about it. A simple solution could be another option in the writing settings, if a new box should open or if user always wants to select via toolbox. BTW you can hit return twice and the box will close. this is how I work, because I mostly write paragraphs and I want to do that without selecting the toolbox again. Another hint: You can add any kind of (one line) markdown in the paragraph box, too, so you can also add a ##headline and it will transform into a headline.

thenktor commented 2 years ago

Thanks for the double enter hint, did not notice this, yet 👍

JTorresConsulta commented 6 months ago

In may case, the text editor save and close automatically when y push ENTER key. But when I am writting I need to create new paragraphs

How to avoid auto save and close when I push ENTER key to generate a new paragraph?

JTorresConsulta commented 6 months ago

I solved. I remove in vue-box.js file:

@keyup.enter="submitBlock"

JTorresConsulta commented 6 months ago

I have to think about it. A simple solution could be another option in the writing settings, if a new box should open or if user always wants to select via toolbox. BTW you can hit return twice and the box will close. this is how I work, because I mostly write paragraphs and I want to do that without selecting the toolbox again. Another hint: You can add any kind of (one line) markdown in the paragraph box, too, so you can also add a ##headline and it will transform into a headline.

How to insert single lines in the content? When I do a single line with "shift+enter" the edition remove the single line.

trendschau commented 3 months ago

I am sorry, with the release of v2 there is too much todo and I loose some issues. You can add a single line by adding two spaces at the end of a line. This will create a soft linebreak (br).

If you remove code like keyup.enter, then I don't know if you will face other errors (it might break the block-logic of the editor).

Maybe the raw editor is a better option in your case? In version 2 the raw editor also has highlighting for markdown now.

May I ask to open a new issue if something still unclear in version 2 so I can close this ticket? I try to cleanup github issues a bit.