Make WordPress Core

Opened 16 years ago

Closed 12 years ago

Last modified 12 years ago

#11616 closed enhancement (wontfix)

Text copied form visual editor don't store font color

Reported by: warsheep's profile warsheep Owned by:
Milestone: Priority: normal
Severity: minor Version: 2.9
Component: TinyMCE Keywords:
Focuses: Cc:

Description

if i copy something out of the post editing tool, and if i paste it into another, the color is not copied too.
Just the "bold / underline ect..."

i have to ajust the color every time myself :(

Attachments (1)

11616.diff (653 bytes) - added by solarissmoke 15 years ago.

Download all attachments as: .zip

Change History (14)

#1 @Simek
16 years ago

  • Component changed from General to Formatting
  • Priority changed from normal to low
  • Severity changed from normal to minor
  • Summary changed from i have found a bug to Text copied form visual editor don't store font color
  • Version set to 2.9

Tested and confirmed for 2.9.0.

Until we decide to fix it or check if it isn't TinyMCE bug You can still copy text in HTML format (from HTML tab), paste into next post (into HTML tab) and switch to Visual Editing Mode.

#2 @Simek
16 years ago

  • Keywords dev-feedback added

#3 @hakre
16 years ago

This needs to be checked against the default tinymce implementation and reported upstream in case this is considered a bug. (Can confirm the report as well.)

#4 @azaozz
16 years ago

  • Type changed from defect (bug) to enhancement

This is an option in the cleanup on paste in TinyMCE. It can be allowed but it may behave erratically in different browsers leaving behind empty tags or a lot of inline styles. Also the current setting produces cleaner code when pasting from Word.

#5 @kwdavids
16 years ago

  • Cc kwdavids added
  • Priority changed from low to normal
  • Type changed from enhancement to defect (bug)

Given that it was working in previous versions, I can hardly call this an "enhancement"; it is a major and serious defect, and it is causing me major problems and hours of hand editing HTML to maintain my site.

I might add that it not only affects text color and HTML table background color pasted into the visual editor, it also trashes color when pasting Microsoft Word text into the Microsoft Word Insert box. So perhaps code from Word is cleaner, but it is also wrong.

The "workaround" does not work because the HTML editor window introduces line breaks gratuitously in the text, basically wrecking layout in complex layouts. If HTML pasting worked, that would be one thing, but it generally does not.

So in summary, it is broken and there is no workaround.

#6 @Denis-de-Bernardy
16 years ago

  • Keywords dev-feedback removed
  • Milestone changed from Unassigned to Future Release
  • Type changed from defect (bug) to enhancement

let's label this as WP enhancement (less bugs across platforms) but TinyMCE bug (strips colors during copy/paste operations).

has anyone reported this upstream, to MoxieCode?

#7 @kwdavids
16 years ago

Could someone explain why something that used to work and stopped working is not a defect?

I'm trying to be patient here, but one of the most popular features on my blog is this huge color-coded HTML table that needs frequent updating, and it is virtually impossible to maintain in WordPress because of the limitations of the visual editor in handling tables, and the limitations of the HTML editor in editing complicated HTML and in the fact that it converts every carriage return/linefeed to <br />.

Back at WordPress 2.8, I could just copy and paste from the visual display of my HTML editor, and everything was fine. Now what I consider a major public service on my blog is unmaintainable. I'll probably have to redesign the whole thing from scratch.

Even Microsoft Word's publish to blog gets mangled.

I'm having a crisis here and folks are saying "oh, let's call it feature."

@solarissmoke
15 years ago

#8 follow-up: @solarissmoke
15 years ago

  • Keywords has-patch dev-feedback added

You have to set the option paste_retain_style_properties for the TinyMCE paste plugin to retain styles copied from Word - which we currently don't (it seems like the plugin defaults must have changed at some point if it used to work before).

I've added a patch that does this, however you have to disable two other options - paste_remove_styles and paste_remove_spans - for it to work. This could cause unintended side-effects, so I'm not sure it's a good idea.

#9 in reply to: ↑ 8 @azaozz
15 years ago

  • Keywords close added; has-patch dev-feedback removed

Replying to solarissmoke:

...so I'm not sure it's a good idea.

Agree. Don't think it's a good idea to allow pasting of arbitrary HTML in the Visual editor. Apart from the security concerns, it can conflict with the current theme (CSS) and break the front end.

Also it is very easy to add for people that really need that. All settings are available here.

#10 @miqrogroove
12 years ago

  • Component changed from Formatting to Editor

#11 @iseulde
12 years ago

  • Component changed from Editor to TinyMCE
  • Keywords close removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

#12 @azaozz
12 years ago

This is partially fixed in trunk: copying and pasting whitin the editor (or copying from one editor and pasting in another) preserves inline styles/text color. Copying from a web page and pasting in the editor removes all inline styles, same as before.

#13 @iseulde
12 years ago

Ah, nice! I didn't know that. :)

Note: See TracTickets for help on using tickets.