Exactly what does Copy as Styled Text copy?

40 views
Skip to first unread message

Rob Russell

unread,
Oct 9, 2025, 4:19:33 AM (2 days ago) Oct 9
to BBEdit Talk
I'm trying to work out precisely what is copied when you copy as styled text.
colour_differences.jpg
I have a css document with coloured syntax highlighting. When I copy as styled text and paste into a rich text document, the colours don't necessarily match. The image below shows the differences (BBEdit left, TextEdit right).

My assumption was that the displayed colours would be reflected in the clipboard, but apparently not. Could it be some interaction with Text Colours defined in settings? Anyone know?

Thanks
Rob

Kevin Shay

unread,
Oct 9, 2025, 7:04:58 AM (2 days ago) Oct 9
to bbe...@googlegroups.com
This may or may not help you figure this out, but I put together a little site to help expose what exactly is on your system clipboard:


(Not widely tested—please let me know if anything doesn't work!) It looks like "Copy as Styled Text" produces three separate versions on the clipboard: plain text, HTML, and RTF. I'm not too familiar with the format, but maybe you can poke through the output there to see if the color declarations are not as expected?

Kevin

--
This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bbedit/df83481c-7daa-46f6-b118-63b240d27e9dn%40googlegroups.com.

Rob Russell

unread,
Oct 9, 2025, 6:33:42 PM (2 days ago) Oct 9
to BBEdit Talk
On Friday, 10 October 2025 at 00:04:58 UTC+13 Kevin Shay wrote:
This may or may not help you figure this out, but I put together a little site to help expose what exactly is on your system clipboard:



That is enlightening. The clipboard does have at least two versions, HTML and plain text. I note that the html styling is different to what is shown in the bbedit window, following some html formatting rules.

coloured_html.jpg

you can see that with the first selector, ":root" is black text in the bbedit window on the left (css is the active language selector), but the clipboard html defines color: #850052 (a purple). 

That explains what I'm seeing.

Maybe one of the Barebones people can elaborate on what is used when building the clipboard?

Rob
Reply all
Reply to author
Forward
0 new messages