Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minimal markdown editor - spaces not always handled as monospace in code block #699

Open
MorgothSauron opened this issue Sep 23, 2019 · 5 comments

Comments

@MorgothSauron
Copy link

commented Sep 23, 2019

When I paste text for a terminal application into SN inside a code block, monospace is not always used. Example in the following screen capture of SN minimal MD editor:
Screenshot_20190923_221353

It's not easy to see, but the text is not aligned properly. If I insert spaces it will not be the same width as a character.

An other example using the output of the neofetch command. The pasted text in SN does not use the same spacing as the original text.

  • Actual output from terminal:
    Screenshot_20190923_221937
  • Code block rendering in the editor:
    Screenshot_20190923_222035

The rendering is correct in preview mode of the simple markdown editor.
Screenshot_20190923_222405

The minimal MD editor should be able to render code block properly.

@MorgothSauron

This comment has been minimized.

Copy link
Author

commented Oct 14, 2019

I see the same behavior with the ouput of other commands like postgres psql command.

  • Actual output in Putty
    image

  • Code block rendering in SN minimal markdown editor
    image

  • Same note in the simple markdown editor
    image

@mobitar

This comment has been minimized.

Copy link
Member

commented Oct 15, 2019

Won't be able to prioritize this, but definitely open to PRs: https://github.com/sn-extensions/minimal-markdown-editor

@MorgothSauron

This comment has been minimized.

Copy link
Author

commented Oct 15, 2019

If I remember correctly the SN editor is based on CodeMirror, right ?

If yes, I copy/pasted text directly from my note into CM and the rendering is correct there. neofetch does not look exactly like in the console, but at least the spacing is ok
image
image

I would help, but I'm not familiar with SN and the "technology" it use. But with some "tips" I can give it a try.

@mobitar

This comment has been minimized.

Copy link
Member

commented Oct 16, 2019

The Code Editor, Advanced MD Editor, and Vim Editor are also based on CodeMirror. Can you check if this issue happens there?

@MorgothSauron

This comment has been minimized.

Copy link
Author

commented Oct 16, 2019

I tested different editors as suggested. I used the same note and I switched between editors. I also include the plain text editor for "reference"

  • Code Editor
    code-editor

  • Advanced MD
    advanced

  • Vim
    Screenshot 2019-10-16 20 08 20

  • Plain Editor
    Screenshot 2019-10-16 20 11 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.