Opened 9 months ago

Closed 8 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
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 9 months ago by Tade0

Component: GeneralPlugin : Paste from Word

comment:2 Changed 9 months ago by Marek Lewandowski

Priority: NormalNice to have (we want to work on it)
Status: newconfirmed
Summary: "height" style gets stacked in spans in Paste from Word(PFW)"height" style gets stacked in spans in Paste from Word

comment:3 Changed 8 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 8 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 8 months ago by Tade0 (previous) (diff)

comment:5 Changed 8 months ago by Tade0

Owner: set to Tade0
Status: confirmedreview

Adjusted pushing styles lower, updated unit tests.

Changes pushed to branch:t/16821.

comment:6 Changed 8 months ago by Marek Lewandowski

Resolution: fixed
Status: reviewclosed
Summary: "height" style gets stacked in spans in Paste from WordExtraneous 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