[RFC] Complex list
To follow up the discussion about list (#79)
Handling lists is a complex issue. When it's only a small list of text, it's pretty easy. Problems come from multiple paragraphs as a single item of the list (for example):
<li>blah</li>
vs
<li>
<p>blah</p>
<p>blah</p>
</li>
The li
and ul
element are at a higher level in the dom.
In this case, you dont replace a paragraph with a li
, you surround it with a li
. And the numbering comes from those semantics.
Options:
- create a ADD TO ITEM button, only appearing after the last element of the
<li>
, which would let you add element to an item (images, table, other paragraph);
This UI is just for example, as it needs more work, but the idea is to keep the list builder simple and the action near the spot where it will change things in the editor.
An exemple of how it can be made is Prosemirror has some interesting elements concatenation that may be a way to do it: wrap paragraph into block level element (list, div, figure) which is an interesting way to do it, usability in mind.