Jump to content

Paste as rich text


Recommended Posts

Hello,

 

When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme.

See screens:

posting on Dark theme

 

Could contain: Person, Human, Text, Menu

Same post, switched to Light theme :

Could contain: Page, Text, Person, Human, Envelope, Postcard, Mail

 

Completely messed up post on Dark theme.

Could contain: Text, Mobile Phone, Electronics, Phone, Cell Phone, Menu, Page

 

How can i fix this ? I moved from XF to IPB and never had this issue before.

Waiting for your reply.

Link to comment
Share on other sites

Just now, Marc Stridgen said:

The above would indeed be your only option there. The issue is that the source you are copying from has a background and text colour set, and so its pasting exactly what was copied there

Is IPS going to edit this in the editor in a new version ?

XF and VB dont copy the background. And i dont want to go back to those companies. I love IP

Link to comment
Share on other sites

3 hours ago, Denniz38 said:

When i copy info from the internet and paste in my IP forum, the layout is completely messed up when using Dark and light theme.

I found your topic here too. As I said earlier on Ehren's forum different browser might be a workaround:

Quote

Chromium browsers preserve background unlike Firefox:

image.png.f6a3ebda28bede61cc1d99ea20a2c29e.png

The only "solutions" to prevent such issue is either using Firefox for copying or globally disabling Rich text:

ACP > Customization > Editor > Settings > Always paste as plain text

 

Link to comment
Share on other sites

19 hours ago, Luuuk said:

Perhaps editing a CKEditor config file will help:

your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js

See Filtering Pasted and Dropped Content + pasteFilter documentations.

Possibly something similar to this:

CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';

 

What is the best way to place this line in the ckeditor.js file?

Link to comment
Share on other sites

It means that if you want to make a change to the CKEDITOR config then that is the best way to do it.

In short...

  1. Edit your globalTemplate template in your theme.
  2. At the bottom, before closing </body>, add the following and then save the template
<script>
if(typeof CKEDITOR != 'undefined'){
	CKEDITOR.config.pasteFilter = '<WHATEVER>'
}
</script>
Edited by Nathan Explosion
Link to comment
Share on other sites

14 hours ago, Nathan Explosion said:

You are not editing a JS file - you should be editing the globalTemplate in your theme.

 

I have placed this in the GlobalTemplate but no difference.

Could contain: Text, Menu

 

The posts are exactly the same as without this code.

When i use the remove formatting button on the post, thats the way it should look like.

 

 

Link to comment
Share on other sites

I helped you with this bit:

21 hours ago, Denniz38 said:

What is the best way to place this line in the ckeditor.js file?

I didn't help you with this bit:

On 9/7/2022 at 3:09 PM, Luuuk said:

Perhaps editing a CKEditor config file will help:

your site folder > applications > core > interface > ckeditor > ckeditor > ckeditor.js

See Filtering Pasted and Dropped Content + pasteFilter documentations.

Possibly something similar to this:

CKEDITOR.config.pasteFilter = '*[color]; *{color, background-color, text-decoration}';

 

<WHATEVER> is a placeholder for your actual configuration...

Link to comment
Share on other sites

8 minutes ago, Nathan Explosion said:

I helped you with this bit:

I didn't help you with this bit:

<WHATEVER> is a placeholder for your actual configuration...

Thanks but still confused, im not a coder.

Could contain: Text

my background is black and my font is white on my website.

How to place in the code ?

Edited by Denniz38
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...