Hi all,
Just letting you know I was just looking for an option to copy code fences to the clipboard, as this is incredibly useful especially for huge chunks of YAML for pre-made UI widgets.
Turns out the option already existed in Discourse, so naturally I activated it. You’ll get a little button in all code fences and you can click on it to copy the entire thing to the clipboard. Then you can simply paste it wherever you need it. No more selecting a bunch of code around with the mouse.
Note that using GitHub Gists (if you don’t want to create a full-fledged repo) and copying the link is also a very clever alternative for these pieces of code, since it’s overall better presented and the versioning is clearer too.
In the meantime, since it doesn’t work well, I have disabled the plugin, and found another option to use the 3-backticks instead of 4-space indents for the “preformatted text” button.
So you can simply use the </> (7th) button on the toolbar, or the Ctrl-Shift-C shortcut to insert a code fence (or toggle the code fence for the selected text).
But … it looks like code is wrapped now/then for long lines of code while a scrollbar was used before for long code text. Code is not as nice readable as before - or do I miss something ?
But … it looks like code is wrapped now/then for long lines of code while a scrollbar was used before for long code text. Code is not as nice readable as before - or do I miss something ?
I see a horizontal scroll here.
I poked the <> button, which produces prompt -
‘’’
type or paste code here
‘’’
and pasted in as invited.
Yes, you are right a test shows the behavior as you described it. I am sure I used that button, too but the line is wrapped in an other thread.
I will have a look at it next time again.
With todays forum software upgrade, I also switched to the fork of that plugin and enabled it.
While the buttons are there, their icon seems to be missing, though, so it is a bit hidden…: