Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#13634 closed Bug (wontfix)

Headers fomatted as lists are not pasting properly from word

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

Description

Steps to reproduce

  1. Copy and paste the contents of example.docx (Attached to ticket) into a CKEditor instance.

Expected result

The second header should be it's own list

Actual result

The second header is appended to the end of the list above it (See attached screen shot)

Other details (browser, OS, CKEditor version, installed plugins)

Google Chrome, OSX, 4.5.2

Attachments (2)

example.docx (31.0 KB) - added by Brant 9 years ago.
screenshot.png (46.6 KB) - added by Brant 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Brant

Attachment: example.docx added

Changed 9 years ago by Brant

Attachment: screenshot.png added

comment:1 Changed 9 years ago by Piotrek Koszuliński

Resolution: wontfix
Status: newclosed
Version: 4.5.2

This is the HTML that CKEditor is dealing with:

<p class=MsoNormal style='margin-top:5.1pt;margin-right:0cm;margin-bottom:0cm;
margin-left:18.15pt;margin-bottom:.0001pt;text-indent:-12.35pt;mso-pagination:
none;mso-list:l1 level1 lfo2;tab-stops:18.2pt'><![if !supportLists]><b><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:Arial;mso-fareast-language:EN-US'><span style='mso-list:
Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span></b><![endif]><b
style='mso-bidi-font-weight:normal'><span lang=EN-US style='mso-bidi-font-size:
11.0pt;mso-fareast-font-family:Cambria;mso-fareast-theme-font:minor-latin;
mso-hansi-font-family:Cambria;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:
"Times New Roman";mso-bidi-theme-font:minor-bidi;letter-spacing:-.05pt;
mso-fareast-language:EN-US'>Header 1</span></b><span lang=EN-US
style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;mso-bidi-font-family:
Arial;mso-fareast-language:EN-US'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:18.0pt;text-align:justify;text-justify:
inter-ideograph;mso-pagination:none;tab-stops:41.85pt'><span lang=EN-US
style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;mso-bidi-font-family:
"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-fareast-language:EN-US'>This
is some example content<span style='letter-spacing:-.05pt'>.<o:p></o:p></span></span></p>

<p class=MsoNormal style='margin-left:18.0pt;text-align:justify;text-justify:
inter-ideograph;mso-pagination:none;tab-stops:41.85pt'><span lang=EN-US
style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;mso-bidi-font-family:
"Times New Roman";mso-bidi-theme-font:minor-bidi;letter-spacing:-.05pt;
mso-fareast-language:EN-US'>This is an example list:</span><span lang=EN-US
style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;mso-bidi-font-family:
"Times New Roman";mso-bidi-theme-font:minor-bidi;mso-fareast-language:EN-US'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-top:5.2pt;margin-right:0cm;margin-bottom:0cm;
margin-left:41.8pt;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;
text-indent:-18.0pt;mso-pagination:none;mso-list:l2 level2 lfo3;tab-stops:41.85pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-size:11.0pt;font-family:Wingdings;mso-fareast-font-family:
Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-language:EN-US'><span
style='mso-list:Ignore'>v<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span><![endif]><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;
letter-spacing:-.05pt;mso-fareast-language:EN-US'>List item 1</span><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;
mso-fareast-language:EN-US'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-top:.65pt;margin-right:0cm;margin-bottom:0cm;
margin-left:41.8pt;margin-bottom:.0001pt;text-align:justify;text-justify:inter-ideograph;
text-indent:-18.0pt;mso-pagination:none;mso-list:l1 level2 lfo2;tab-stops:41.85pt'><![if !supportLists]><span
lang=EN-US style='mso-bidi-font-size:11.0pt;font-family:Wingdings;mso-fareast-font-family:
Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-language:EN-US'><span
style='mso-list:Ignore'>v<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span><![endif]><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;
letter-spacing:-.05pt;mso-fareast-language:EN-US'>List item 2.</span><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;
mso-fareast-language:EN-US'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-top:6.0pt;margin-right:0cm;margin-bottom:0cm;
margin-left:24.45pt;margin-bottom:.0001pt;text-indent:-18.7pt;mso-pagination:
none;mso-outline-level:1;mso-list:l0 level2 lfo1;tab-stops:24.35pt'><![if !supportLists]><b><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:Arial;mso-fareast-language:EN-US'><span style='mso-list:
Ignore'>1.1<span style='font:7.0pt "Times New Roman"'>&nbsp; </span></span></span></b><![endif]><b><span
lang=EN-US style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;
mso-bidi-font-family:"Times New Roman";mso-bidi-theme-font:minor-bidi;
letter-spacing:-.05pt;mso-fareast-language:EN-US'>Header (I will be pasted
incorrectly)</span></b><span lang=EN-US style='mso-bidi-font-size:11.0pt;
mso-fareast-font-family:Arial;mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;mso-fareast-language:EN-US'><o:p></o:p></span></p>

<p class=MsoNormal style='margin-left:24.45pt'><span lang=EN-US
style='mso-bidi-font-size:11.0pt;mso-fareast-font-family:Arial;mso-bidi-font-family:
"Times New Roman";mso-bidi-theme-font:minor-bidi;letter-spacing:-.05pt;
mso-fareast-language:EN-US'>Here is some more example content</span><span
lang=EN-US><o:p></o:p></span></p>

Looking at it I can say that it is hard to imagine some better result than what CKEditor achieves:

<ol>
	<li><strong>Header 1</strong></li>
</ol>

<p>This is some example content.</p>

<p>This is an example list:</p>

<ol>
	<li>List item 1</li>
	<li>List item 2.</li>
	<li><strong>Header (I will be pasted incorrectly)</strong></li>
</ol>

<p>Here is some more example content</p>

The thing that should mark list items in the Word's messy HTML are the mso-list styles. And they present this way:

  • mso-list:l1 level1 lfo2;
  • none
  • none
  • mso-list:l2 level2 lfo3;
  • mso-list:l1 level2 lfo2;
  • mso-list:l0 level2 lfo1;
  • none

No sense at all. The only thing CKEditor can do is to turn every Word's pseud-paragraph which has this style into a list item.

comment:2 Changed 9 years ago by Brant

To confirm, this issue is due to an incompatibility on how MS Word handles lists and how HTML handles lists?

comment:3 Changed 9 years ago by Piotrek Koszuliński

One thing is that MS Word and HTML have different capabilities. It definitely won't be able to represent some MS Word documents' semantic in HTML.

Second thing is what MS Word puts into clipboard when copying from it. This isn't even HTML... this is some non semantic mess. It's very hard to reason based on what we get so even if there's some (deeply hidden) sense in that HTML I posted in comment:1 we will not be interested in mining for it. This would be very time consuming and the result could not be satisfactory (if there would be any) because of what I wrote above – the difference in semantics.

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