-
Notifications
You must be signed in to change notification settings - Fork 18
Support for lists indentation in pasted content added #53
base: master
Are you sure you want to change the base?
Conversation
@Mgsy Could you take a look and test if everything works fine? |
Pull Request Test Coverage Report for Build 183
💛 - Coveralls |
Steps to reproduce
Current resultThe second list item has no text and contains the list element. Screenshot |
Steps to reproduce
Current resultThe content is broken. Screenshot |
There is a general problem with compatibility of nested list items between Word and content we can generate in the editor. In Word you could easily create a list items which are nested many levels deep. In the editor the difference in indentation between consecutive list items can be only one level (at least when you upcast view - didn't checked if you can create it by modifying the model itself because it is irrelevant in this case). For example, list in Word like: can have it's indentation aligned and be represented as:
or the second item can be wrapped in additional list to keep the same indentation level as in Word:
I went with the second approach to keep the proper indentation, that's why in #53 (comment) there is one empty list element. The second case (#53 (comment)) is caused by the same mechanism as mentioned above, however there is one more thing going on. In the 4th step:
Word creates a new list instead of changing bullet type in the same list so you end up with 3 separate lists. And then again, nesting mechanism kicks in which handles the case when first list item has some indentation so it creates this strangely looking lists. So the above issues mentioned by @Mgsy are in fact intended behaviour, but the question is if we want it to work that way. As mentioned before there are two possible approaches: Keep the same indentation as in Word by additional nestingThis is how it works now, so indentation will be kept when pasting from Word. This can be achieved by adding additional nesting to pasted lists. And so the transformed content will look like below (left is Word document, right after pasting to the editor): Normalize list indentationThe indentation could be normalized in a way there are no empty lists created, it will look like below (again, left is Word document, right after pasting to the editor): This approach creates less confusing and more "correctly looking" content, but the indentation is lost in some cases. WDYT @Mgsy @Reinmar should we normalize indentation here or stay with nesting? |
Thanks for the clarification, now I understand what happened. The approach you used makes sense for me, but still isn't something that I expected. I got in my mind that in the editor I can't create additional nesting as easy as in Word, so I expected that those indents will be normalized. For me, the current output was just confusing and unreadable. From the other hand, this solution keeps the user's intentions and changing it might be unwanted (but as well as adding additional lists). Not sure how we should deal with it, but for me, I'll go with normalizing this kind of indents. |
Not that anyone asked about my opinion but I agree with @Mgsy |
I agree with @Mgsy too. So R- :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented – normalization should work differently.
What is the status on this please? Desperately needed. |
hey guys any updates on this one? |
Unfortunately nothing new – we're not working on this PR nor plan to do so. What could help us prioritise it is more 👍 under ckeditor/ckeditor5#2518 because from the current look of things, it's not a very popular feature request. |
Suggested merge commit message (convention)
Feature: Support for lists indentation in pasted content added. Closes ckeditor/ckeditor5#2518.
Additional information
See ckeditor/ckeditor5#2518.