yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.9k stars 322 forks source link

🔨 Formatter: Auto add hard line breaks #1426

Open mlaidouni opened 4 months ago

mlaidouni commented 4 months ago

Proposal

Is it possible to have the formatter automatically add two spaces at the end of lines when there is a break?

I mean, if you activate this option :

image

Each line break is considered as a line break in the preview. But this change is not taken into account on Github. To have a real line break, you need two spaces at the end of the line. Is it possible that, when you make a line break in the editor, the formatter automatically adds two spaces to the previous line? This could be an option in the parameters.

So, actually, the result of a line break is the first image, and it would come the second. image image

I don't know if I'm making myself clear. I'm not talking about the render in the preview, I'm talking about the behaviour of the editor.

This option would really help me, I always forget the two spaces at the end, even though the "Hard Line Break" icon is already a great help 😅

Other information

Thanks for all the work you've done, your extension is the best I've tried on VSCode, I use it every day 🙏🏼 🙏🏼 🙏🏼

yzhang-gh commented 3 months ago

Thanks.

This is strange as to my memory GitHub by default retains the "soft" line breaks.

This is
a new line

This is a new line

mlaidouni commented 3 months ago

Oh you're right ! I thought it was mandatory to use hard-line-breaks. In addition, tt seems that the result isn't the same when the changes are made on phone.

Thanks for help ! 🙏🏼