Jump to content

Copying Colourful Spans


Llyarden

Recommended Posts

Something rather curious I've noticed lately. If you copy text with a colour from a post, then the colour disappears - I know this is intended behaviour.

If it's your post and you edit it before copying, however, it works...unless you copy an entire span that's got a colour assigned to it, and not just a segment of one. If you try to copy-paste an entire span with a colour into a new post, it doesn't merely strip out the colour - it strips out the entire span, content and all.

Is this intended as another way to discourage us from using colours other than the theme-aware ones offered by the editor, or is it a bug?

Link to comment
Share on other sites

Sounds like you are using a CSS markup that the html sanitizer is stripping out when you save.

Eric will be able to tell you for sure if you can post the markup here.

If that is the case, it is not by our design but that of the security features of the software itself.

Link to comment
Share on other sites

Posted (edited)

To be clear, this is a post that I've already made, that has gotten saved with all the sanitisers and stuff. It's when I try to copy that same text to a new post that it acts oddly - and copying from source works perfectly.

This is some example text.  Let's put a nonbreaking space in here (at the beginning of this sentence) and see what happens...

Like all good bugs it's also inconsistent; I can't reproduce it from this post, but I have got a screen recording of it happening. Scratch that, I figured it out.

Edited by Llyarden (see edit history)
Link to comment
Share on other sites

Okay, I think I found a way to reproduce this consistently. It seems to occur if the text being copied contains a nonbreaking space (ie  ) in. I put one manually in the message above, but the sanitiser likes to do it at times on its own.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...