Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested lists sometimes broken when pasting from Word #15964

Closed
mabryl opened this issue Mar 4, 2024 · 2 comments · Fixed by #16007
Closed

Nested lists sometimes broken when pasting from Word #15964

mabryl opened this issue Mar 4, 2024 · 2 comments · Fixed by #16007
Labels
package:list package:paste-from-office squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@mabryl
Copy link
Contributor

mabryl commented Mar 4, 2024

📝 Provide detailed reproduction steps (if any)

  1. Download the sample files: broken-list.docx, working-list.docx
  2. Paste the contents into the Paste from Office Enhanced demo
  3. Compare the results

✔️ Expected result

The subitems should be retained when pasting the contents of the first file, as is the case in CKE4, for example:

image

❌ Actual result

The first two subitems change into regular list items and move to the bottom of the document:

image

❓ Possible solution

I wasn't able to reproduce this behavior with a fresh Word file (working-list.docx). Not sure what the difference is between these two lists.

📃 Other details

  • Browser: cross-browser
  • OS: cross-OS
  • First affected CKEditor version: N/A
  • Installed CKEditor plugins: N/A

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

@mabryl mabryl added type:bug This issue reports a buggy (incorrect) behavior. package:list package:paste-from-office support:2 An issue reported by a commercially licensed client. squad:core Issue to be handled by the Core team. labels Mar 4, 2024
@filipsobol
Copy link
Member

filipsobol commented Mar 5, 2024

When pasting content from Office, we detect list items when they are <p> or <h1> to <h6> elements with a mso-list style. This works fine in working-list.docx document from above, as all items are <p> tags.

However, for whatever reason, the first nested list in broken-list.docx is a <ul> with <li> elements. This does not satisfy our current requirements.

Simply adding li to the RegExp detects bunch of other elements as list items, so this needs further investigation.

This works fine in other editors.

@dgibbons
Copy link

dgibbons commented Mar 5, 2024

I have found another document from a different source that has a similar but different problem. In this case, several of the bullets are re-ordered in the document.

Here is a screenshot of the behaviour:

Screenshot 2024-03-04 at 3 25 58 PM

Note that this appears to be a bug with the "paste from office enhanced" plugin, as the "without paste from office enhanced" plugin is not showing this issue. Paste from office enhanced is not getting the bullet nesting correct, however.

CK4 gets the order correct, and the nesting correct:

image

Ideally the Paste from Office plugin would work as well as CK4 does here.

Test word doc here: Missing bullets example.docx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:list package:paste-from-office squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
4 participants