Zettelkasten-Team / Zettelkasten

Zettelkasten-Developer-Builds
http://zettelkasten.danielluedecke.de
GNU General Public License v3.0
730 stars 92 forks source link

Code formatting #447

Closed DudeMcGee closed 1 year ago

DudeMcGee commented 1 year ago

When I format passages in a note as code, either with the inline code or the [code] feature, spaces get lost when the note has been saved and is displayed for reading.

Is there any method to do some classical typewriter-style formatting which will be kept when the note is displayed?

Thx a lot, greetings!

mateusbraga commented 1 year ago

Hi @DudeMcGee,

Some questions to clarify as I didn't understand the bug.

If possible, some screenshots of what you typed, what happened to it, and what you are looking for.

Regards!

DudeMcGee commented 1 year ago

I have created two screenshots, one shows the edit window and the other one shows the normal view on notes. I have chosen a fixed font to view my notes.

ZKN3-Code-Edit ZKN3-Code-View

In the Format menu you find two items, Code and Inline Code, to format code. Only Ctrl-Alt-C works as expected for me.

I'd like to have white spaces kept, esp. if the view font is a fixed font but obviously they get lost in the process of storing the note. The whole issue isn't a big problem, I can get my work done using Menu -> Format -> Code (Ctrl-Alt-C).

Thanks for your attention, my best wishes to the team!

mateusbraga commented 1 year ago

Thanks for the screenshots.

I am new to this part of the code. I am going to write here what I understood. Feel free to skip this part if you want:

Regarding how to proceed with this issue:

So I think you should use [code] for this particular use case in the meanwhile. When support to Markdown arrives, it should be better. (Markdown support seems to be tracked in https://github.com/Zettelkasten-Team/Zettelkasten/projects/1)

I am going to close this issue, but feel free to reopen to continue a discussion.