Copying code now copies HTML instead of what's visible

6StringJazzer

Well-known Member
Joined
Jan 27, 2010
Messages
3,750
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
It seems there has been a software update that affects how code is copied. If code is marked as Rich or VBA and I copy it
Rich (BB code):
        Application.ScreenUpdating = False
it pastes back like this:
Rich (BB code):
        Application<span>.</span>ScreenUpdating <span>=</span> <span>False</span>

I recall being able to copy code segments and paste it into a response so it is as-viewed. Can this be fixed?
 
I’m afraid this can’t be fixed, as it appears to be the behavior of the text editor the forum software uses.

When we copy text from a BBCode block, the operating system also copies the formatting (colors, line breaks, etc..) by adding extra tags that a rich editor (like Word) can convert to the actual formatting. In previous versions, the editor seemed to handle "paste" by accepting the content as "text only" (at least, that’s how it makes sense and as I believe it worked this way before). Unfortunately, that’s no longer the case.

However, there are two workarounds:
  1. Using the ‘Code Copy’ button. We implemented this feature while ago and made it compatible with the recent update. While this isn’t practical for partial copy-pasting, it works fine for copying the entire block.

    1728491673140.png
  2. Using the ‘Paste without formatting’ option. On a Mac, I use Ctrl + Command + Shift + V for this. On Windows, it should be Ctrl + Shift + V instead of the usual Ctrl + V.
    * I just double-checked, and yes, on Windows it’s ‘Paste as plain text’ with Ctrl + Shift + V.

    1728491901461.png

Edit: As an additional workaround: If you paste the copied content in BB Code toggle mode, then it will be pasted without formatting.
1728493957646.png


Hope this helps.
 
I’m afraid this can’t be fixed, as it appears to be the behavior of the text editor the forum software uses.
Perhaps I need to clarify that sentence. Of course, it can be fixed, but it’s not something we can do that on our end since the text editor is third-party software used by the forum. Hopefully, the text editor will be fixed in a future update, and we’ll regain the expected old behavior.
 
I take it that it has been reported to XenForo?
Yes, Mark. Their response was a usual "It is an editor issue, I guess". And the workaround #2 which I also recommended (the original application doesn't have option #1 anyway).
 
I'll be able to use the workarounds you posted (actually when I came across it, I copied it to my VBE and done a find/replace on </span> and <span> and copied it from there). I'm just a bit concerned about the experience for the majority who don't frequent the About The Board forum, but hopefully XenForo will get it sorted relatively quickly.
 
Last edited:

Forum statistics

Threads
1,226,453
Messages
6,191,136
Members
453,642
Latest member
jefals

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top