Opened 7 years ago

Closed 9 months ago

Last modified 9 months ago

#6342 closed Bug (fixed)

Paste from Word fails to transform into a custom style with an attribute

Reported by: Frank Owned by:
Priority: Normal Milestone: CKEditor 4.6.0
Component: Plugin : Paste from Word Version: 3.1
Keywords: Cc: michael.bruegmann@…

Description

In principle, the "pastefromword" plugin regards basicStyle configuration. For example, if you configure CKEDITOR.config.coreStyles_bold to be <strong>, any clipboard content detected as bold will be transformed to a <strong> element. However, if you define a basic style using attributes, e.g. like in the example given in the documentation of CKEDITOR.config.coreStyles_italic:

CKEDITOR.config.coreStyles_italic = { element : 'span', attributes : {'class': 'Italic'} };

then an <i> element from the clipboard is correctly transformed into <span class="Italic">, but afterwards, the class attribute is filtered out, so only a <span> without attributes remains, which seems to be removed later. Thus, underlined text from Word is pasted without this format.

The correct filter application order would be to filter the attributes of the clipboard content first, then apply the transformation into the (custom) basic style, but not filter again after that step.

Change History (5)

comment:1 Changed 7 years ago by Sa'ar Zac Elias

Keywords: word paste custom basic style removed

comment:2 Changed 5 years ago by Jakub Ś

Status: newconfirmed
Version: 3.43.1

To reproduce:

  1. Set in contents.css
    .Italic{font-style:italic;}
    
  2. In config.js enter
    config.coreStyles_italic = { element : 'span', attributes : {'class': 'Italic'} };
    
  3. Clear cache and reload the page
  4. Paste italic text from Word.

Result: Test from word is not pasted as plain text without any spans.

comment:3 Changed 4 years ago by Frederico Caldeira Knabben

Component: Core : PastingPlugin : Paste from Word

comment:4 Changed 9 months ago by Tade0

Resolution: fixed
Status: confirmedclosed

Fixed with new Paste From Word plugin in 4.6.0.

comment:5 Changed 9 months ago by Anna Tomanek

Milestone: CKEditor 4.6.0
Summary: pastefromword fails to transform into custom style with attributePaste from Word fails to transform into a custom style with an attribute
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy