Jump to content

Community

Pasting as "Rich Text" but making text color = default


Recommended Posts

So we have this problem in our community where we developed a "dark mode" template for members who just prefer things that way, whether it is easy on the eyes or to save battery on their mobile devices. However, we've run into this conundrum and cannot seem to fix it....

We have "Paste behavior" set to Rich Text with giving the members the option to paste as Plan Text instead. If a member copies text that was originally designated as black and pastes it into the his post, the black text color attribute carries over into the post as part of that Rich Text. Members who use our dark mode template, in which the content area is black, will not see any quoted text, because it matches the background.

Obviously, we could change "Past as Rich Text" always to "Paste as Plain Text" always, and we did that, then got a fair amount of complaints, so we switched it back. It's now an issue of a small amount of dark theme lovers vs the small amount of paste-as-rich-text lovers. If we could retain the Rich Text but strip away the text color attribute that would be perfect. We just need all text to be "default" so that it shows up dark on the white background and as light on the dark background.

It there a way to make this happen by modifying something in the Invision code or the CK Editor code?

Link to comment
Share on other sites

I personally see no generic solution fitting all communities, of course except of disabling the Rich Text pasting globally or letting the users remove the formatting manually. There are a lot of scenarios when pasted text in a different color than the default color should be retained and turning the color automatically to match the default color will be unwelcome.

There are also other "issues". For example, copying a text from Google Chrome automatically preserves a background. So after swapping a theme (light>dark) you will see something like:

background.png.a0108dc19ca2d5338083ad5dbf09ac89.png

 

 

 

Link to comment
Share on other sites

6 hours ago, opentype said:

About what exactly?

I'm not Robert, but members complained about not being able to design nice looking post templates and tables and having the ability to just quickly copy and paste anywhere they pleased from one source, google word documents specifically which has nice formatting options that we can't add to the editor for reasons Invision gives anytime someone asks for extra fonts and whatnot.

I would love to turn the editor into plain text only, turn on html, and limit which html attributes/tags members can use, sorta like DeviantArt's post system where they can only make div boxes with basic css like align, background, text-decoration, font styles/colors, and borders.

Edited by ahc
Link to comment
Share on other sites

Being a person that has had a dark theme since.... well forever (I've been using Dark themes as the primary for my sites since even before I started using Invision) this is more an issue with how things are being copy-pasted then it is with the CKEditor that Invision uses.

To explain:

Type a message in a word editor, don't change anything, then copy and paste it into the editor. No issues:

Quote

This is an example.

Type a message in a word editor and change stuff:

Quote

This is an example.

I just bolded there, but still no issue.

Now change your default color in the editor:

Quote

This is an example of a different color.

 

If you actually look at each example (in which I used Open Office Writer to create. I simply typed a phrase, then bolded the word then added more and changed the color) the only one that changes the font color is the last one and that is because I intentionally changed it in the word editor itself. (Use the inspect tool to verify). Techincally, the editor is doing what its told. Most likely your users are changing the color in their personal editors to something that isn't considered "default" which is truly causing the issue not the other way around. The editor is doing what its told.

Link to comment
Share on other sites

  • 1 month later...
On 5/2/2020 at 12:02 PM, opentype said:

About what exactly?

Many members compose their comments in Microsoft Word or some other editor and customize it to their delight, and then paste it into the Editor on the forum. But if "paste as plain text" is enable, all that effort is lost.

 

I created a "night mode" template which some members are using, but when someone copy and pastes from the web and the text is designated as "black" then they cannot see it against the black background, and they usually yell at one another, which gets annoying. I'm half tempted to remove the "dark mode" template altogether.  

Link to comment
Share on other sites

You should. As I stated in the post directly above yours if you use the default color in the editor (like word) it will paste correctly into the editor. Changing the colors for your template is what is causing your issues here. 

Link to comment
Share on other sites

Let me refine my complaint with the following scenario...

 

MemberJohn visits a news site on the web, selects a paragraph from the article, copies it, and then pastes it into my forums CK Editor, and submits it as a post.

 

If the CSS for the news site had set the text to black, then the 'paste as rich text' feature will paste it as black. When a member using a dark template views it, he cannot see the black text over the black background.

 

I know the user could highlight the text and change it to default, but none of them care to. I would love for there to be a way to automatically change all text to default while retaining the other rich text capabilities. So far, it seems my only option would be to set paste behaviour to 'paste as plain text', but then the other group of members get mad.

 

Catch 22 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy