Open dstoc opened 3 months ago
Proposal: [Enter] creates adjacent paragraphs,
Except when:
This may solve insert-after in general, even for transclusions.
As for insert-before. Maybe something similar can work for first-child? E.g. to insert-before a transclusion, move the cursor to the start then press
in a list-item, it will create an adjacent list-item
Unless it's not just a simple list item, that is it contains more than a single paragraph.
There are lots of special cases.
With sections for example, when there's a section inside a list-item, the adjacent paragraph generated after the section gets consumed by the section in normalization. We probably want to insert a subsequent list-item instead, but what if there's a subsequent section? I think we need to introduce a mechanic that can split the contents of a list-item across multiple list items.
There already exist other problems now that this may help to solve, for example:
* a
* b
c
Attempting to unindent "b", results in:
* a
c
* b
Some further thoughts on this, undistilled.
Splitting seems pretty complex, and I'm not sure there's an inverse. But maybe that's OK?
What can be split?
[Enter] has currently has magical and broken behavior.
The reason... it seemed desirable that pressing [Enter] in a list item would create a sibling list item. The workaround [Shift-Enter] creates an adjacent paragraph within the list item.
Following on from that, it seemed reasonable that this behavior would apply to other block types. Pressing [Enter] in a block quote would create a paragraph adjacent to the block quote.
However, this feels wrong when the block-quote contains other items like sections -- because pressing [Enter] in a section still creates an adjacent paragraph in the section.