Jump to content

Copy/Paste background issue.


bwatford

Recommended Posts

Users continue to have problems when copy/pasting that the background color of the page they are copying from comes with their paste and you can't easily get rid of it without going into source. This happens all the time when copying from ogmw.

 

Can we have the CKEditor strip background colors when copy/pasting? I believe the Advanced Content Filter can do that, even if it means turning off background colors in the editor, it would be a big help in the transition from the old site to the new one.

Link to comment
Share on other sites

1 hour ago, Scarecrow71 said:

You can always right-click and select "Paste as plain text".

But if it strips the background, you could keep the formatting from things that are copy/pasted.  

I personally copy to MS Word first and then copy from there which strips the background, but was trying to make it easier for everyone.

Link to comment
Share on other sites

6 minutes ago, Eric said:

I think I have this one fixed! Please give it a try.

It is stripping backgrounds out of copy paste and retaining "most" of the other formatting.

 

The only issue I see now is if it is black (color:#000000;) you are copying then it comes over as black and is unreadable on dark themes.

 

Maybe have it strip out color:#000000; tags so that way the color defaults to the base color of the theme.  

If we can do that then migrating from Myth-Weavers will no longer need to be plain text (hopefully)

Link to comment
Share on other sites

Color is now stripped as well. Limiting to just #000000 may be problematic in other ways (depending on how the source provides the HTML, it could be in a variety of formats so writing a regex to catch them all is difficult).
Link to comment
Share on other sites

16 minutes ago, Eric said:
Color is now stripped as well. Limiting to just #000000 may be problematic in other ways (depending on how the source provides the HTML, it could be in a variety of formats so writing a regex to catch them all is difficult).

Don't want to strip colors.  We just want to strip black.  Not limiting to #000000, removing #000000 altogether,

Link to comment
Share on other sites

Sometimes it's #000000. Sometimes it's rgb(0,0,0). Sometimes it's rgba(0,0,0,0). Sometimes it's black.

 

There are lots of different ways to represent black 🤣 Writing regex for it is more difficult.

 

Try it now.

Link to comment
Share on other sites

Testing a copy/paste from OGMW here: (image resized is the only thing I had to do.)
 
 
spacer.png
Tiadora
A mysterious woman that showed up at Brandescar prison
 



As soon as the guards leave, and Felonius has his say and then whispers to her, asking who she was, Tiadora’s demeanor immediately changes. She drops all pretense of grief or concern. She is immediately all business.

“Have you forgotten me, dearest?” the unexpected visitor says with a smirk, dropping her pretense of grief. “Call me Tiadora." she says as she removes a elbow high glove from one of her hands and lays it on the table. "Let's just say that we possess a mutual friend who would like to meet you, and your fellow cell-mates. Unfortunately, our mutual friend is unwilling to visit you in your present rather shabby accommodations." she says as she rolls her eyes and looks around the room as if disgusted by what she sees.

"So it seems my dearest that you, and your friends will simply have to escape." she sighs.

Link to comment
Share on other sites

Ok that was a straight copy paste but at first it stripped the image out completely because it was not a https link.  Seems images must be https links to copy/paste correctly.

 

Not a big issue otherwise.  Looks good.

 

And Color #000000 is the only way I have seen color come over in a copy/paste.  So should be good there.

Will do some more testing, may need to revise "best practices" for Myth-Weavers moving if all goes well.

 

EDIT: Scratch that... text is still black. Color:#000000 still came with it.

Link to comment
Share on other sites

×
×
  • Create New...