Opened 5 months ago

Closed 4 months ago

#16821 closed Bug (fixed)

Extraneous spans with height style stacked when pasting from Word

Reported by: Tade0 Owned by: Tade0
Priority: Nice to have (we want to work on it) Milestone: CKEditor 4.7.0
Component: Plugin : Paste from Word Version: 4.7.0 (GitHub - major)
Keywords: Cc:

Description

When encountering an element that has multiple styles the PFW plugin creates a stack of span elements each having one of these styles.

This way this:

<span style="font-size: 50px; color: red; font-weight: bold">Test</span>

Becomes this:

<span style="font-size: 50px">
  <span style="color: red">
    <span style="font-weight: bold">Test</span>
  </span>
</span>

Some styles should not be stacked though - one of them is the height style.

Problem is - this happens.

Change History (6)

comment:1 Changed 5 months ago by Tade0

  • Component changed from General to Plugin : Paste from Word

comment:2 Changed 5 months ago by m.lewandowski

  • Priority changed from Normal to Nice to have (we want to work on it)
  • Status changed from new to confirmed
  • Summary changed from "height" style gets stacked in spans in Paste from Word(PFW) to "height" style gets stacked in spans in Paste from Word

comment:3 Changed 4 months ago by Tade0

I'm getting some weird behaviour when disabling stacking for this style(it gets removed - probably by ACF which does not allow such a style in inline elements).

Investigating.

comment:4 Changed 4 months ago by Tade0

This is pretty unusual: According to the editor.filter.allowedContent property in the tests a td with a height style should be allowed(true in the manual test), and yet it is not present in the final output.

EDIT: nevermind, I misinterpreted removing spans with height as removing height altogether.

Last edited 4 months ago by Tade0 (previous) (diff)

comment:5 Changed 4 months ago by Tade0

  • Owner set to Tade0
  • Status changed from confirmed to review

Adjusted pushing styles lower, updated unit tests.

Changes pushed to branch:t/16821.

comment:6 Changed 4 months ago by m.lewandowski

  • Resolution set to fixed
  • Status changed from review to closed
  • Summary changed from "height" style gets stacked in spans in Paste from Word to Extraneous spans with height style stacked when pasting from Word

Code change was OK, but there was no manual test provided.

I added the manual test, and rebased the branch. While rebasing there were tons of conflicts, since there were some massive changes on master related to PFW lately, so I have recreated the fixtures.

Fixed with git:58726c64b1985769caacb626282f05d2e7b24611, merged to major.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy