Opened 10 years ago

Closed 10 years ago

#12842 closed Bug (duplicate)

[pasteFromWord] Regression after #12750: underline and strike are removed on multiple spaces

Reported by: Piotr Jasiun Owned by: Piotr Jasiun
Priority: Normal Milestone:
Component: Plugin : Paste from Word Version:
Keywords: Cc:

Description

After #12750 if more than one space is between words the underline and strike is removed from these parts.

Attachments (1)

Screenshot from 2015-01-22 14:50:19.png (165.9 KB) - added by Piotr Jasiun 10 years ago.

Download all attachments as: .zip

Change History (9)

Changed 10 years ago by Piotr Jasiun

comment:1 Changed 10 years ago by Piotr Jasiun

I tried fix this condition what fix missing <s> and <u> over multiple spaces and do not break exiting tests (the problem is that empty block also contains only &nbsp; which should not be underlined/struck in this case). Also I have added support to the <strike> element, because in same cases pasted content contains <strike> instead of <s>. But there is still some problems (see No image "Screenshot%20from%202015-01-22%2014%3A50%3A19.png" attached to Ticket #12842). This is not because of mentioned condition, nor because of isContainingOnlySpaces method and was fine before #12750. Also I am not able to easily merge contiguous text nodes now, because they can be wrapped in various tags.

Now my idea is to use moveToText on the second run of filter when the whole clean up is already done. It may fix both problems.

Changes in t/12842.

Last edited 10 years ago by Piotr Jasiun (previous) (diff)

comment:2 Changed 10 years ago by Piotr Jasiun

Owner: set to Piotr Jasiun
Status: newassigned

comment:3 Changed 10 years ago by Piotr Jasiun

Editor configuration:

var editor = CKEDITOR.replace( 'editor1', {
	pasteFromWordRemoveFontStyles: false,
	pasteFromWordRemoveStyles: false
} );

IE11 Input (pasted HTML):

<font color="#000000" face="Times New Roman" size="3">

</font><p style="margin: 0cm 0cm 10pt;"><s><u><span lang="EN-US"><font face="Calibri"><font color="#000000" size="3">This&nbsp;</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;</font></span><font color="#000000" size="3">i</font><span style="color: red;"><font size="3">s</font><span style="mso-spacerun: yes;"><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><font size="3">&nbsp; a</font><span style="mso-spacerun: yes;"><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span style="mso-spacerun: yes;"><font size="3">&nbsp;</font></span><font size="3">tes</font></span><font color="#000000" size="3">t&nbsp;</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;</font></span><font color="#000000" size="3">data&nbsp;</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;
</font></span><font size="3"><span style="mso-spacerun: yes;"><span style="color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span style="color: red;"></span></font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;</font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;</font></span><font color="#000000" size="3">for&nbsp;</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;</font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;</font></span><font color="#000000" size="3">tes</font><span style="color: red;"><font size="3">ti</font></span><font color="#000000" size="3">ng&nbsp;&nbsp;
</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;</font></span><font color="#000000" size="3">new&nbsp;</font><span style="mso-spacerun: yes;"><font color="#000000" size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><font color="#000000" size="3">CKEDITOR</font></font></span></u></s></p><font color="#000000" face="Times New Roman" size="3">

</font>

Paste From Word filter output:

<p style="margin:0cm 0cm 10pt;"><span style="font-size:medium;"><span style="font-family:calibri;"><s><u>This&nbsp;</u></s><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;</u></s></span></span><s><u>i</u></s><span style="color:red;"><span style="font-size:medium;"><s><u>s</u></s></span><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><span style="font-size:medium;"><s><u>&nbsp; a</u></s></span><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;</u></s></span></span><span style="font-size:medium;"><s><u>tes</u></s></span></span><s><u>t&nbsp;</u></s><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;</u></s></span></span><s><u>data&nbsp;</u></s><span style="font-size:medium;"><s><u>&nbsp; </u></s></span></span><span style="color:red;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u></s></span><span style="font-size:medium;"><s><u>&nbsp;&nbsp;</u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;</u></s></span></span><s><u>for&nbsp;</u></s><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;</u></s></span></span><span style="font-size:medium;"><s><u>&nbsp;&nbsp;</u></s></span></span><s><u>tes</u></s><span style="color:red;"><span style="font-size:medium;"><s><u>ti</u></s></span></span><s><u>ng&nbsp;&nbsp; </u></s><span style="font-size:medium;"><s><u>&nbsp;&nbsp;</u></s></span></span><s><u>new&nbsp;</u></s><span style="font-size:medium;"><s><u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </u></s></span></span><s><u>CKEDITOR</u></s></span></span></span></p>

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

I'm going to have fun! Lots of fun! So happy to work on the MSWord output again! Best feeling ever, because I know that whatever I do I will never do more damage than guys that designed this.

comment:5 Changed 10 years ago by Piotr Jasiun

I have implemented strike and underline clean up as a separate filter which is run after the standard one, what seems to fix the problem. Changes in t/12842b.

comment:6 Changed 10 years ago by Jakub Ś

Component: GeneralPlugin : Paste from Word

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

Milestone: CKEditor 4.4.8

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

Resolution: duplicate
Status: assignedclosed
Version: 4.4.7 (GitHub - master)

Let's merge this into #12750 since it was reopened.

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