Copying Code-Fenced Text

AI-generated summary

RobMeade requested a “Copy to Clipboard” feature for code-fenced text, suggesting a button in the bottom-right corner. dax replied that this feature is already available in the Discourse core, and can be enabled in site settings by searching for “show copy button on codeblocks”. amotl thanked dax for pointing this out, and confirmed that the feature works as expected.

Hi,

Could code fencing be enhanced to provide a Copy to Clipboard feature, currently, a CTRL+A selects all of the text in the whole window, not just the text in the fenced area when it’s focused.

Perhaps something like this in the bottom right and corner?

3 Likes

The “copy to clipboard” function has been added to the Discourse core a long time ago. There is no need to install a plugin for it.

In your site settings search for show copy button on codeblocks .

3 Likes

Hi Daniela,

Oh, I did not know that and I am feeling a bit silly now ;]. Thank you for making me aware of that, it works like a charm.

With kind regards,
Andreas.

1 Like