Jump to content

Pasting from Visual Studio Code into a Code block has broken formatting


Recommended Posts

If you copy from Visual Studio Code on the Mac and past it into Evernote it pastes correctly with full colour, formatting, indenting, etc.

But if you paste it into a Code block in Evernote the formatting is terrible. By default everything is has double lines (a blank line between each line) and the indenting disappears completely. If you paste with "paste and match style" you at least get rid of the blank lines, but the indenting still disappears.

If I copy the text to something else (Outlook, Word, etc) and then paste it into an Evernote Code block it formats correctly.

Link to post
  • 4 months later...

Yes this!

I find the same issue with the latest version of Evernote for Mac {Version 7.14 (458265 App Store) Editor: 69.3.10951 (15add1e)} and Visual Studio Code (Version: 1.47.3).

When writing in YAML, spaces indicate syntax and without the spaces preserved, it's either time consuming and error prone to add them in afterwards, or makes pasted text unusable without spaces (thank you Jody Fanning for the workaround of pasting it into another app first!). Preserving spaces/indetation is important for writing YAML (https://en.wikipedia.org/wiki/YAML) files and is used by QA Engineers to edit CircleCI or Github .yml files.

Ex.:

on: 
  pull_request:
    paths-ignore:
    - 'README.md'

results in:

on: 
pull_request:
paths-ignore:
- 'README.md'


The resulting yaml will fail when ran.

It's weird and a little ironic that this support website with an arguably more basic text editor allows adding codeblocks that preserve pasting indentation/whitespace/spaces.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...