Jump to content

[Defect] Pasting into Code Blocks Removes CRLF Formatting


Recommended Posts

I've discovered that if you copy and paste blank lines into a code block, then click away from the note to a different note and then go back to the note, the blank lines will get removed.

Consider the attached screenshot. The top code block I copied from SQL Server Management Studio and pasted into the code block (I also tested copying from notepad to see if this made any difference and it didn't). In the bottom code block, I pasted the same text except I manually removed the blank line and added it back in. I then clicked away from the note to a different note, went back to this note and the top code block where I copy/pasted with the blank line had its blank line removed.

I am on version 10.4.4 Build 2096

PasteLineBreaks.JPG

Link to comment
5 hours ago, jh1989 said:

I've discovered that if you copy and paste blank lines into a code block, then click away from the note to a different note and then go back to the note, the blank lines will get removed.

I've always found blank lines of code are treated a bit randomly by both the legacy version and V10, with the former tending to add lines and the latter remove them. That's for me mainly pasting R code from R Studio.

Have you tried ctrl-shift-V (paste and match style)?  I've no idea if it would help in your case but worth a try.

Link to comment
  • Evernote Expert

Here's a thing...

If I paste the code into the note, highlight and select code block then the LFs stick.

If I take an existing code block and paste into that the LFs get removed when the note is viewed in the manner described... ;)

@Mike P's suggestion to use Ctrl+Shift+V did not, sadly, make a difference.

 

  • Sad 1
Link to comment
5 hours ago, agsteele said:

If I paste the code into the note, highlight and select code block then the LFs stick.

 

You're right that does work, I'll try to remember to use this method of inserting code until this (hopefully) is addressed one day.

Link to comment

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...