Separate lists pasted from Microsoft Office merge into a single list / Faulty list continuation detection
📝 Provide detailed reproduction steps (if any)
- Create a list in outlook that looks something like this:
- Copy and paste the list into the CKEditor
- Notice that all the separate lists are merged into one single list.
Here is the raw content that is pasted in from the clipboard: multi list paste content.txt
✔️ Expected result
Lists shouldn't be merged.
❌ Actual result
Lists are inappropriately merged.
❓ Possible solution
This appears to be caused by code in ckeditor5-paste-from-office\src\filters\list.js. The isListContinuation function is inappropriately treating all LI elements as members of the same list.
📃 Other details
- Browser: Chrome 133
- OS: Windows 11
- First affected CKEditor version: Unknown
- Installed CKEditor plugins: PasteFromOffice
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
Note, this can be reproduced on the public CKEditor 5 demo sites.
Thanks for the report, could you name the Outlook version you are testing?
Microsoft® Outlook® for Microsoft 365 MSO (Version 2412 Build 16.0.18324.20240) 64-bit
I'm hesitant to share this because it seems quite fragile, but I have some code in place that does address the issue without breaking the changes put in place to address issue #15964. But I'll include it here in case it helps as a starting point:
/**
* Whether the given element is possibly a list continuation. Previous element was wrapped into a list
* or the current element already is inside a list.
*/
function isListContinuation(currentItem) {
const previousSibling = currentItem.element.previousSibling;
if (!previousSibling) {
// If it's a li inside ul or ol like in here: https://github.com/ckeditor/ckeditor5/issues/15964.
let parent = currentItem.element.parent;
return isList(parent) && isList(parent.parent);
}
// Even with the same id the list does not have to be continuous (#43).
return isList(previousSibling);
}
function isList(element) {
if(!element)
{
return false;
}
return element.is('element', 'ol') || element.is('element', 'ul');
}
@Witoso, can you add the support tag to this issue since we are commercially licensed?
Please contact our support, there's a process of labeling tickets as well attaching companies to inform them about resolution via that channel.
Im also having this issue
@Witoso could you please share the estimates when the fix is planned to be released? We're also having this issue (we're commercially licensed).
I checked it on Firefox 138 with recent master and:
- Microsoft Outlook New 1.2024.1126.100 (client version 20250620014.12).
- Microsoft Outlook Classic 2021
and it works fine.
In my case, I discovered that some word documents were using duplicate ids for the problematic lists. Not sure how that happened though.
John Richardson Fullstack PHP developer
*m. 07957918063 w. http://john-richardson.net e. @.
If you're happy with the services provided, please consider leaving a review on Trustpilot https://www.trustpilot.com/evaluate/john-richardson.net. Thanks.
On Mon, 30 Jun 2025, 07:11 Mateusz Bagiński, @.***> wrote:
Mati365 left a comment (ckeditor/ckeditor5#18015) https://github.com/ckeditor/ckeditor5/issues/18015#issuecomment-3017922414
I checked it on Firefox 138 with recent master and:
- Microsoft Outlook New 1.2024.1126.100 (client version 20250620014.12).
- Microsoft Outlook Classic 2021
and it works fine.
— Reply to this email directly, view it on GitHub https://github.com/ckeditor/ckeditor5/issues/18015#issuecomment-3017922414, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTS6YEAAGQQTA5O5M6IB233GDIILAVCNFSM6AAAAABYA5VMJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMJXHEZDENBRGQ . You are receiving this because you commented.Message ID: @.***>
@maryia-kabash , sorry for the late reply, we were closing a pretty big release scope, and this was the next item on the list. Thankfully, we managed to find a solution just in time, and this should be a part of the next release.