# How to insert a codeblock to copy?

**URL:** https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152
**Category:** Support
**Created:** [January 24, 2021, 1:45am UTC](https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152 "2021-01-24T01:45:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AmzDis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amzdis/32/206482_2.png) [@AmzDis](https://meta.discourse.org/u/AmzDis)
#### Post date: [January 24, 2021, 1:45am UTC](https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152/1 "2021-01-24T01:45:15Z")

</div>

Hi Justin,

We installed the latest Discourse version 2.7.0.Beta2, and enable the ‘Add a button to codeblocks to copy the block contents to the users’s clipboard. This feature is not supported on Internet Explorer.’ from ‘Settings’ → ’ Posting’.

 ![d3d2683ff66b2349a5114d161a29471](https://global.discourse-cdn.com/meta/original/3X/a/e/ae91a84309b6a0c47a301a9d2cc005527175b7f3.png)

How can we post the codes that have the copy button？

Example, how can I add below code has the copy button?

> This is my code, and want to show the copy button.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 24, 2021, 2:22am UTC](https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152/2 "2021-01-24T02:22:04Z")

</div>

Use the insert code button in the composer:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/6/f61181ea31a2aa959de262aef9b16e4b04fadaf8.png)

```
a = [1..10].shuffle

```

---

<div class="post-metadata">

### Author: ![AmzDis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/amzdis/32/206482_2.png) [@AmzDis](https://meta.discourse.org/u/AmzDis)
#### Post date: [January 24, 2021, 2:31am UTC](https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152/3 "2021-01-24T02:31:12Z")

</div>

Great.  
Finally, I got it. I spent 2 hours google and search the [meta.discourse.org](http://meta.discourse.org). Saved a lot time.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 13, 2023, 3:06pm UTC](https://meta.discourse.org/t/how-to-insert-a-codeblock-to-copy/282152/4 "2023-10-13T15:06:02Z")

</div>

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