Opened 11 years ago

Last modified 8 years ago

#9991 closed Task

Paste from word should only normalize input data — at Version 18

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone: CKEditor 4.6.0
Component: Plugin : Paste from Word Version:
Keywords: Drupal Cc: wim.leers@…

Description (last modified by Piotrek Koszuliński)

Transformations and clean up are done by #9829 and #9989. Thus, PFW has to be rewritten so it won't double these core features.

Spec: https://gist.github.com/Reinmar/cc012b20bf37be84a523 (WIP)

Change History (18)

comment:1 Changed 11 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:2 Changed 11 years ago by Piotrek Koszuliński

Type: BugTask

comment:3 Changed 11 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:4 Changed 11 years ago by Anna Tomanek

Adding #10267 as a test case for this issue.

comment:5 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.2

This ticket is about rewriting PFW from scratch and this is immense amount of work, so it will not be included in 4.2.

comment:6 Changed 11 years ago by Piotrek Koszuliński

Description: modified (diff)

comment:7 Changed 11 years ago by Piotrek Koszuliński

#10327 should go before this ticket.

comment:8 Changed 11 years ago by Piotrek Koszuliński

<td style="background:Yellow">...</td>
or:
<span style="background:Yellow">...</span>

We need transformation that will extract background-color which we understand, from background which we remove. We should add these transformations for more CSS properties. I'm not only sure how can we automatically create them from e.g. config.colorButton_backStyle. We may need to add new settings for styles which would guide the filter.

Duplicate: #10364.

Last edited 11 years ago by Piotrek Koszuliński (previous) (diff)

comment:9 Changed 11 years ago by Piotrek Koszuliński

Another rooms for improvements can be find in the way we fixed #10348:

  • transformations could accept elements list instead of one element only,
  • transformations for align attribute on blocks is needed.

comment:10 Changed 11 years ago by Jakub Ś

#10558 was marked as duplicate.

comment:11 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4

comment:12 Changed 10 years ago by Frederico Caldeira Knabben

Component: Core : PastingPlugin : Paste from Word

comment:13 Changed 10 years ago by Frederico Caldeira Knabben

We’re not supposed to drastically change the way things are done right now. Most of the changes are to happen in the cleanup logic.

The following are some notes about how things (will) work.

  • Basic workflow:
    1. Listens for the “paste” with priority “3”
    2. Sniffs the paste date for word stuff.
    3. If from word, calls CKEDITOR.cleanWord.
    4. Updates the paste event data with the cleaned data.
  • It allows to have custom "cleanWord” implementations through configuration and on-demand file loading. I’m unsure about the point about this as one could eventually simply write a plugin that would override the default plugin behavior. Anyway, we don’t have to change this right now and it can be a v5 thing.
  • The default cleanWord implementation will not do the deep cleanup it does today. It’ll instead “normalize” the HTML in a way that it has proper semantics, using proper HTML features. The cleanup part will be left to ACF. This is all about this ticket, in fact.
  • The default cleanWord implementation is based on data processing, mainly.
  • What to do with the current configurations:
    • pasteFromWordPromptCleanup: I don’t feel that this is necessary any more… actually it may still exist but by default it may depend on ACF, if it’s enabled.
    • pasteFromWordRemoveFontStyles: we can keep this
    • pasteFromWordNumberedHeadingToList: ???
    • pasteFromWordRemoveStyles: I have the impression that this is not needed any more. Only if we want to keep it so one could decide to have cleaner paste from Word, even if the editor support style features.

So the current idea is developing tests and write the cleanup logic from scratch, reusing what’s is reusable from the current implementation.

comment:14 Changed 10 years ago by Wim Leers

Any idea on the ETA?

This is one of the things we need to ship Drupal 8. There's no beta yet, so there's still some time, but we definitely need to close https://drupal.org/node/1955300 before release.

comment:15 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.4CKEditor 4.5

The ETA is 4.5 (so July or August - we may still change ETA for 4.5). More delay is very unlikely because of our plans regarding 4.5 and 5.

comment:16 Changed 10 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.5.0CKEditor 4.6.0

We're sad when we have to do that, but we weren't able to find resources for Paste From Word for the last couple of months. We have to release the drag and drop and file upload support which is ready for in ~75% as soon as possible, so I'm postponing PFW to the next major release.

comment:17 Changed 9 years ago by Piotrek Koszuliński

comment:18 Changed 9 years ago by Piotrek Koszuliński

Description: modified (diff)

I wrote a first draft of the spec (or rather guidelines): https://gist.github.com/Reinmar/cc012b20bf37be84a523

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy