ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Nested lists pasted from Word don't display properly while using Document lists and Indent block

Open Mgsy opened this issue 3 years ago • 1 comments

📝 Provide detailed reproduction steps (if any)

  1. Enable Document lists, Document list properties, Indent block and Paste from Office.
  2. Paste the content from the example - Lorem ipsum.docx

✔️ Expected result

The list displays properly.

❌ Actual result

There is an additional margin for the nested list items.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Mgsy avatar Sep 14 '22 10:09 Mgsy

Actually, I've just noticed that this issue is caused by the Indent block feature that maintains the margin-left attribute on paragraph.

Mgsy avatar Sep 14 '22 10:09 Mgsy

Clipboard normalized HTML view after transformation

<ul style="list-style-type:circle">
    <li class="MsoListParagraphCxSpFirst" style="mso-list:l1 level1 lfo1;text-indent:-18.0pt"><span lang="EN-IN"
            style="font-family:" Courier New";mso-fareast-font-family:"Courier New""></span><span lang="EN-US"
            style="mso-ansi-language:EN-US">Lorem ipsum</span><span lang="EN-IN">
            <o:p></o:p>
        </span></li>
    <li class="MsoListParagraphCxSpMiddle" style="mso-list:l1 level1 lfo1;text-indent:-18.0pt"><span lang="EN-IN"
            style="font-family:" Courier New";mso-fareast-font-family:"Courier New""></span><span lang="EN-US"
            style="mso-ansi-language:EN-US">Lorem ipsum</span><span lang="EN-IN">
            <o:p></o:p>
        </span>
        <ul style="list-style-type:square">
            <li class="MsoListParagraphCxSpMiddle"
margin -->   style="margin-left:72.0pt;mso-add-space:auto;mso-list:l1 level2 lfo1;text-indent:-18.0pt"><span
                    lang="EN-IN"
                    style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span><span
                    lang="EN-IN">Lorem ipsum<o:p></o:p></span></li>
            <li class="MsoListParagraphCxSpMiddle"
                style="margin-left:72.0pt;mso-add-space:auto;mso-list:l1 level2 lfo1;text-indent:-18.0pt"><span
                    lang="EN-IN"
                    style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span><span
                    lang="EN-IN">Lorem ipsum<o:p></o:p></span></li>
        </ul>
    </li>
    <li class="MsoListParagraphCxSpMiddle" style="mso-list:l1 level1 lfo1;text-indent:-18.0pt"><span lang="EN-IN"
            style="font-family:" Courier New";mso-fareast-font-family:"Courier New""></span><span lang="EN-IN">Lorem
            ipsum<o:p></o:p></span></li>
    <li class="MsoListParagraphCxSpLast" style="mso-list:l1 level1 lfo1;text-indent:-18.0pt"><span lang="EN-IN"
            style="font-family:" Courier New";mso-fareast-font-family:"Courier New""></span><span lang="EN-IN">Lorem
            ipsum<o:p></o:p></span></li>
</ul>
<p class="MsoNormal"><span lang="EN-IN"></span></p>
<ol>
    <li class="MsoListParagraphCxSpFirst" style="mso-list:l0 level1 lfo2;text-indent:-18.0pt"><span lang="EN-IN"
            style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin"></span><span lang="EN-IN">Min<o:p>
            </o:p></span></li>
    <li class="MsoListParagraphCxSpMiddle" style="mso-list:l0 level1 lfo2;text-indent:-18.0pt"><span lang="EN-IN"
            style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin"></span><span lang="EN-IN">Lorem ipsum
            <o:p></o:p></span>
        <ul style="list-style-type:square">
            <li class="MsoListParagraphCxSpMiddle"
                style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo2;text-indent:-18.0pt"><span
                    lang="EN-IN"
                    style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span><span
                    lang="EN-IN">Lorem ipsum<o:p></o:p></span></li>
            <li class="MsoListParagraphCxSpLast"
                style="margin-left:72.0pt;mso-add-space:auto;mso-list:l0 level2 lfo2;text-indent:-18.0pt"><span
                    lang="EN-IN"
                    style="font-family:Wingdings;mso-bidi-font-family:Wingdings;mso-fareast-font-family:Wingdings"></span><span
                    lang="EN-IN">Lorem ipsum<o:p></o:p></span></li>
        </ul>
    </li>
</ol>

Witoso avatar May 08 '23 07:05 Witoso

The potential scope would be dropping margin-left in cases when it's on ol/ul/li (and Paste from Office). This aligns also with @jacekbogdanski goals.

Witoso avatar May 08 '23 07:05 Witoso

Potential blocker for @jacekbogdanski's case - we would fix it paste, and they need it for the data pipeline as well.

Witoso avatar May 08 '23 12:05 Witoso

I think the plan minimum is to make IndentBlock stop upcasting margin-left from <li> to a paragraph. Dunno how this could be technically achieved, but logically speaking, it does too eager upcast conversion.

Reinmar avatar Jul 04 '23 11:07 Reinmar

Would be great to see this addressed. We've had several customers flag this issue

108signals avatar Jul 24 '23 18:07 108signals

Scope:

IndentBlock stop upcasting margin-left from <li> to a paragraph.

Rel: #14155

Witoso avatar Aug 03 '23 07:08 Witoso