Opened 7 years ago

Closed 8 months ago

Last modified 7 months ago

#6342 closed Bug (fixed)

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

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


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 Saare

  • Keywords word paste custom basic style removed

comment:2 Changed 5 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version changed from 3.4 to 3.1

To reproduce:

  1. Set in contents.css
  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 3 years ago by fredck

  • Component changed from Core : Pasting to Plugin : Paste from Word

comment:4 Changed 8 months ago by Tade0

  • Resolution set to fixed
  • Status changed from confirmed to closed

Fixed with new Paste From Word plugin in 4.6.0.

comment:5 Changed 7 months ago by Anna

  • Milestone set to CKEditor 4.6.0
  • Summary changed from pastefromword fails to transform into custom style with attribute to Paste 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