# Update to "Quick copy to clipboard" feature for Markdown content

**URL:** <https://community.noloco.io/t/update-to-quick-copy-to-clipboard-feature-for-markdown-content/953>\
**Category:** Feature Requests\
**Tags:** feature-request\
**Created:** [July 9, 2024, 10:16am UTC](https://community.noloco.io/t/update-to-quick-copy-to-clipboard-feature-for-markdown-content/953 "2024-07-09T10:16:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nick](https://community.noloco.io/u/nick)\
**Post date:** [July 9, 2024, 10:16am UTC](https://community.noloco.io/t/update-to-quick-copy-to-clipboard-feature-for-markdown-content/953/1 "2024-07-09T10:16:16Z")

</div>

**Request Details**

1. Add a text field and set “Display as” to “Markdown”
2. The field is now displayed to the end user with the Markdown formatting applied.
3. Enable the “Quick copy to clipboard” toggle for the field

**Current Behaviour**  
Clicking the copy button copies the raw field content, including the Markdown formatting

**Requested Behaviour**  
Clicking the copy button copies the rich text of the field as it’s displayed. It can then be easily copied into other systems, for example posting on social media. This could be an option on the quick copy configuration.

```auto
async function copyToClip(elementId) {
    const rich = document.getElementById(elementId).innerHTML
    const plain = document.getElementById(elementId).innerText    
    if (typeof ClipboardItem !== "undefined") {
        const html = new Blob([rich], { type: "text/html" });
        const text = new Blob([plain], { type: "text/plain" });
        const data = new ClipboardItem({ "text/html": html, "text/plain": text });
        await navigator.clipboard.write([data]);
    } else {
        const cb = e => {
            e.clipboardData.setData("text/html", rich);
            e.clipboardData.setData("text/plain", plain);
            e.preventDefault();
        };
        document.addEventListener("copy", cb);
        document.execCommand("copy");
        document.removeEventListener("copy", cb);
    }
}

```
