Copy button in code block is tiny if no language label is specified

Steps to reproduce

create a code block

Expected result

live preview of the block while cursor is outside of block shows copy button

Actual result

copy button is teeny tiny
image
Hovering over it long enough shows a tooltip, but text is otherwise invisible.

Environment

  • Operating system: Windows 10
    image

Verified exists in sandbox

1 Like

Tiny indeed :mag_right:

If you name the block anything, the copy area expands.

```css

```
```latex

```
```ggs

```

1 Like

My personal workaround, when not using any other specific definition:

```copy
it works
```
3 Likes

Reproduced here too. MacOS.

Related FR: No specified language code block copy button support

Want to have the copy button for all the code block.

Only have the copy button for the code block which specified the language.

Also, can I have the copy button when I editing the code block?

2 Likes

Seconded. In Live Preview, blocks without a type don’t have a copy button in the corner.

(Or more correctly, they do have the button, but the text is blank so it’s impossible to find with the mouse :slight_smile: )

CSS snippets can make the invisible button appear, but it’s still not ideal.

.markdown-source-view.mod-cm6 .code-block-flair {
  min-height:2em;
  background-color:var(--background-modifier-cover);
  border:1px solid var(--color-base-40);
}

image

EDIT: Oh, never mind – in live preview the copy button is invisible. I don’t use live preview a lot, so I didn’t see it. Sorry about that.


The copy button is showing for me now in v1.0, even with untyped code blocks.

Is it possible you have a theme, snippet, or plugin interfering?

Yes, it exists, however it’s really too small to do the copy action…
IMO, just add “Copy” text at the position of top-right of the code block will be better:

will be fixed 1.1.14

It appears a new bug may be introduced by this. In live preview, it now shows the language, but in reader view it only shows copy.


it was like this even in 1.1.9

Ah, hadn’t noticed

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.