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)
Change History (9)
Changed 10 years ago by
Attachment: | Screenshot from 2015-01-22 14:50:19.png added |
---|
comment:2 Changed 10 years ago by
Owner: | set to Piotr Jasiun |
---|---|
Status: | new → assigned |
comment:3 Changed 10 years ago by
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 </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </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"> </font></span><font size="3"> a</font><span style="mso-spacerun: yes;"><font size="3"> </font></span><span style="mso-spacerun: yes;"><font size="3"> </font></span><font size="3">tes</font></span><font color="#000000" size="3">t </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><font color="#000000" size="3">data </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><font size="3"><span style="mso-spacerun: yes;"><span style="color: red;"> </span></span><span style="color: red;"></span></font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><font color="#000000" size="3">for </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </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 </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </font></span><font color="#000000" size="3">new </font><span style="mso-spacerun: yes;"><font color="#000000" size="3"> </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 </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </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> </u></s></span></span><span style="font-size:medium;"><s><u> a</u></s></span><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u>tes</u></s></span></span><s><u>t </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </u></s></span></span><s><u>data </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><span style="color:red;"><s><u> </u></s></span><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </u></s></span></span><s><u>for </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </u></s></span></span><span style="font-size:medium;"><s><u> </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 </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><s><u>new </u></s><span style="font-size:medium;"><s><u> </u></s></span></span><s><u>CKEDITOR</u></s></span></span></span></p>
comment:4 Changed 10 years ago by
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
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
Component: | General → Plugin : Paste from Word |
---|
comment:7 Changed 10 years ago by
Milestone: | CKEditor 4.4.8 |
---|
comment:8 Changed 10 years ago by
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
Version: | 4.4.7 (GitHub - master) |
Let's merge this into #12750 since it was reopened.
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 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 ). This is not because of mentioned condition, nor because ofisContainingOnlySpaces
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.