Jump to content
  • 0

Bug report: Formatting issues in code blocks


Ardatur

Idea

[Disclaimer: I have tried to find a proper way to report bugs and failed. "Help & Learning / Submit a request" tells me to "Please submit a ticket" but doesn't say how.]

Greetings.

Copying and pasting in code blocks has been flaky as far as can I remember, but after I updated from 6.4 to 6.6 it has become almost unusable due to formatting being destroyed. I was unable to find a way to paste text into code blocks while preserving the font.

  1. Make a new note.
  2. Click "Code Block".
  3. Type "abc abc abc".
  4. Select any fragment of that line.
  5. Ctrl-C, Ctrl-V.
  6. In Evernote for windows: observe how the font has changed.
  7. In the browser-based client: not just the font, but also the general line height changes (e.g., if you paste text into the second line of the code block, the first line moves vertically).

On a related note, pasting text (into notes in general) contaning newlines is also buggy. In the desktop client:

  1. Copying a full line (including EOL) from a note then pasting it back does not insert the newline.
  2. Copying a full line (including EOL) from another app (e.g. Notepad) then pasting it into a note inserts a double newline. Pressing Ctrl-Z (Undo) after that moves the cursor to an unrelated location.

 

Link to comment

3 replies to this idea

Recommended Posts

  • Level 5*

Hi.  Best place to report bugs is always in that versions release thread;  in this case here -

Having said which,  while I can replicate your 'bugs',  the first one is copying text from a code block - which has a particular style - into a plain text location,  which doesn't.  So the text reverts to 'normal' for that location.  If you paste your copied text into another code block,  you get an exact replica of the first instance.

And adding an extra carriage return has been covered elsewhere in the forums recently - as far as I recall,  it's not possible in 'modern' HTML to determine which (if any) paragraph or style marks to delete.  The work around is to paste into a text-only editor like Notepad to strip out the codes.

Link to comment

Thank you for the comments. A few clarifications are necessary, I believe:

Quote

the first one is copying text from a code block - which has a particular style - into a plain text location,  which doesn't [...] If you paste your copied text into another code block,  you get an exact replica of the first instance.

If you are referring to item 5 in the first list ("Ctrl-C, Ctrl-V"), it does not copy the text into a plain text location, it clipboards the fragment and then immediately pastes it over itself---in place. Thus, the text stays in the code block but its formatting is destroyed. The description above the list explicitly mentions "pasting text into code blocks".

Quote

adding an extra carriage return [...] it's not possible in 'modern' HTML to determine which (if any) paragraph or style marks to delete

When I'm selecting several lines in a code block then do Ctrl-C, Ctrl-V, all newlines are preserved just fine except the last one. So clearly, Evernote does know how to process newlines in general---it just has issues with the trailing newline.

Also, I've just noticed that code block formatting is destroyed when I Ctrl-C, Ctrl-V a single line or its fragment, but not when copypasting several lines from the Evernote client (it's still destroyed when pasting 2+ lines from Notepad). Go figure.

Quote

The work around is to paste into a text-only editor like Notepad to strip out the codes.

Except that it's also buggy: it inserts an extra newline then (and destroys formatting).

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...