Hi. What are you guys using to copy code from the Forums? Discourse “Copy Code” is not there anymore and it is kind of painful to right-click and scroll on long code boxes in order to copy. CMD-A selects the entire page, not just the Code Box. Any shortcut, extension, trick that I am not aware of.
TIA
I had asked the same question and the explanation was that the copy-paste feature was a plugin for the forum’s Discourse software. When the software was updated, the plugin became incompatible with the new version so it was removed.
Hi. Thanks for your reply. I’ve seen that posted around Dec’21. Was just wondering if someone came up with a workaround.
Regards.
To select all of this text and copy it
*without* the Discourse plugin that provides
a "select-all-copy" button,
you have to do it manually.
I see. Hoping for this issue to be fixed in the future as it is very useful. Thank you.
Here’s an option, you can decide if it’s easy enough or not. Depends on the length of the text to be copied for me. This works in Microsoft Edge, I’m assuming it’s similar in other browsers.
Right click in the code window and select “Inspect” from the resulting menu.
A window appears with the code section highlighted.
At the left of the code are ellipsis (3 dots), click that and select Copy > Copy OuterHTML
Paste in Notepad++ (or equivalent) and strip HTML tags. I have a macro recorded for that.
According to this post, the unofficial plugin (to easily select and copy a code block) was removed last year. However, the post is immediately followed by another one claiming the feature was added to the beta version of Discourse.
So either the feature never made it into a release version or it did but nobody realizes it exists (i.e. it’s buried deep in some configuration menu) and so it was never enabled for the Home Assistant community forum (all speculation on my part; I have no knowledge of managing Discourse).
Shoot me a reminder and I’ll look into it when I get back in town
Hi. Thanks for the idea. It’s a pity the function was lost along the way.
That would be great. Thanks.
Sorry, the copy code function, when enabled, causes conflicts with other options and plugins. It makes the entire community unusable. It doesn’t look like we have a choice here. Thanks.
FYI we weren’t using that plugin, we were using the site option. Regardless, it causes conflicts that cannot be resolved. Our hands are tied: Usable forums, or completely broken forums with a copy code function. Pretty easy decision IMO.
Well, Frenck enabled the option again to see if Discourse fixed the issue and it appears to work again. Only time will tell.