-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Implement advanced lists (document lists) #2973
Comments
I found this historical issue about blocks in list items: ckeditor/ckeditor5-design#11 It explains a bit more what problems one could have when mixing list items with blocks. |
Another use case might be for legal documents which need to be published on the web, such as constitutions, contracts, etc. They often have numbered paragraphs and numbers on the headings as well, so in many ways, apart from preamble and explanation, they are complex nested lists. Items often need to have the ability to show a sublist, then return to the text to finish the explanation. There's a good example here: http://weagree.com/weblog/numbering-styles-for-contract-sections/ |
I remember just one case when I needed headings inside lists and that was indeed some legal document. I wonder if such cases shouldn't be solved by styling. At least in the referenced article it would be more convenient to have a CSS rule for a contract, which makes the styling of list items dependent on the nesting level. The top-level list would then just have a "heading-like" style. |
That's not particularly semantic, and doesn't cover the case where a list item begins with a heading then proceeds to have paragraphs about that topic, before the next list item, which also has its own heading and paragraphs. See Section 9 (pp. 12-13) of this model constitution which I recently had to try to mark up for a charity wanting it on their website: https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/562468/Association_Model_Constitution.pdf |
Another use case for the document list is procedures. You need a number list for the step of the procedure. Often pictures (but not limited to images) objects are needed to illustrate the procedure step. Having the image as a sibling of step breaks the numbering. It would be an awful solution to make the user have to set the start number in the next step. Look at every web document type editor like notion, and paper. They all have a way to have more complex list. To not implement the document lists, you are settling to be a simple editor. |
I have a use case were Latex markup is being translated into html for editing in the Ckeditor. I would prefer that the editor didn't just drop elements that it decides are invalid. At the moment we are trying to find a workaround in the translation so that it will spit out something that is safe to give to Ckeditor. |
Same here. I run Brick.do; I asked a customer what they would require to start using Brick for writing documentation, and "lists with multiple elements inside" was the first thing they mentioned. |
Using CKEditor 5 to write numbered instructions is impossible with the current approach. Specifically the lack of ability to add images that highlight an instruction. Lists with multiple elements inside is absolutely needed. |
Adds a markdown "extension" that addresses an incompatibility between - the HTML that showdown produces for lists - the HTML that CKEditor expects for lists When a markdown list item contains multiple lines, showdown puts <p> tags around all list items (and multipple <p> tags for the multi-line list item). See https://github.com/showdownjs/showdown/wiki/Showdown's-Markdown-syntax#known-differences-and-gotchas. CKEditor, on the other hand, forbids paragraphs inside list items. Both are "block" elements in its schema; see https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/schema.html#defining-additional-semantics and block elements cannot contain other block elements. (There is discussion of having a list variant that can contain block elements; see ckeditor/ckeditor5#2973 for more.) So here we add a Showdown rule to replace list item paragraph tags with linebreaks, the same as CKEditor produces.
it will resolve the issue of block elements like images/table inside a list? (right now its just reset the list numbers/remove) |
To conclude this ticket: It's been a long ride – nearly a year-long project. Definitely one of the trickiest feature we ever worked on. Finally, it's over 🎉 Congratulations to @niegowski @arkflpc @CatStrategist @oleq @magda-chrzescian @scofalik and many other that contributed. Big thanks to the @ckeditor/qa-team 🤗 This feature will be a part of the upcoming v34.0.0 release. However, due to its size and complexity, we'll keep it on an "experimental" level for 1-2 releases, meaning that we don't recommend using it in production without assessing the risk. For now, it isn't even covered in the documentation, although this should change sooner. |
I'm very interested in testing out the document list feature but I must be doing something wrong in the implementation. I'm importing DocumentList |
Hi @blairjanis as this ticket was a feature request and is already closed - could you open a new ticket with detailed reproduction steps, editor config, plugins installed, etc., so that we could be able to investigate it? |
Intro
The current implementation of lists assumes that a list item cannot contain any block content – that a list item is the lowest block element.
It means, that what the user sees as a "block" can either be a list item, paragraph or a heading. Never two at the same time.
It's a different model than what we had in CKEditor 4 where we allowed to have paragraphs and headings and other things in list items. The current CKEditor 5's implementation, which I call "article lists" (we can think of a better name), is definitely more limited. Let's clarify the whys and why nots.
Justification
However, before I'll get to that I'd like to clarify that IMO the current implementation isn't temporal. Block elements support won't be ever added to it because, simply, the article and document lists are two separate features. If we'll ever work on the document lists (I guess we'll do), then the developer will have to enable that feature and we yet have to define whether both kinds of lists can coexist in one editor.
Why we decided to work on article lists first:
<p>
s inside, but you can insert<hX>
inside an item using the format dropdown and when you'll remove that format you'll be left with a<li><p>...</p></li>
. You can't remove that<p>
then, you have inconsistent markup and inconsistent styling (paragraphs usually have margins). And this is only one out of many, many issues (pasting, enter, and stability).Why we'll need to work on document lists:
Future
As I mentioned, I see document lists as a separate, opt-in feature. When implementing them we'll need to think on many UX and implementation aspects
<listItem>
can be nested which will mean something different than subsequent items with differentindent
value.Anyway, I wanted to start this topic and write down my concerns because I expect that we'll be asked about our current approach. However, I wouldn't like to think too much on this because I'm sure I just touched the tip of the iceberg.
If you'd like this feature to be implemented, add 👍 to this post.
The text was updated successfully, but these errors were encountered: