When selecting text in a code block, there is no copy command on the context menu

Viewed 23

When selecting text in a code block, there is no copy command on the context menu. Command-c will copy, but there is no copy in the context menu.

2 Answers

Marked 3 now has a Copy menu item in the contextual menu. This will copy as rich text, preserving formatting (e.g. indentation, bold, italics, and colors in code blocks). Copying as plain text does not preserve indentation, so if I decide to support that at some point, it will require a quick HTML->Markdown conversion, which I haven't implemented.

As an aside, I recommend PopClip for all kinds of copy functionality using the mouse.

Ok, what would you expect the Copy menu item to do? Copy plain text, rtf, html?

For the time being I've added the standard Copy command to the contextual menu. It will copy with formatting. If you copy code and paste it into a text editor, it will likely show up without line breaks. I could feasibly convert the HTML to plain text preserving whitespace, but I think for the most part if people really want the plain text code, they have the original Markdown at hand.

I think there are a couple of different situations:

  • If I'm copying text in a code block, usually plain text.
  • If I'm copying an entire document, I'd want some kind of formatting. What I don't know is what is the best kind of formatting. I'm usually pasting into google docs or coda. Something that would retain formatting on paste would be great. For both of those products, it isn't markdown, that's for sure.