-
Notifications
You must be signed in to change notification settings - Fork 47
fix(src): handle new form of list item as paragraph - I192 #194
fix(src): handle new form of list item as paragraph - I192 #194
Conversation
event.preventDefault(); | ||
editor.splitBlock().unwrapBlock(CONST.LIST_ITEM).wrapBlock(CONST.LIST_ITEM); | ||
}); | ||
return true; |
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.
What is the effect of this? Shouldn't it return next()
instead?
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.
I think next()
is resulting in there being a paragraph
in the list_item
and a new paragraph
below, as if a sibling of the list_item
.
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.
I'm confused about this as well. What should be the type returned by onEnter
?
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.
I'm unsure if it should be returning a type. @dselman you may have some insight?
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.
What is moved comment to correct line.unwrapBlock(CONST.LIST_ITEM).wrapBlock(CONST.LIST_ITEM)
doing on line 37? Why would we unwrap a list item just to wrap it again?
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
… - I192 Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
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.
Some questions.
@@ -89,8 +89,6 @@ const schema = { | |||
nodes: [ | |||
{ | |||
match: [ | |||
{ object: 'text' }, | |||
{ type: 'link' }, |
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.
Shouldn't this include lists as well?
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.
I believe so, but I think that should be left for another issue when we add support for nested lists.
event.preventDefault(); | ||
editor.splitBlock().unwrapBlock(CONST.LIST_ITEM).wrapBlock(CONST.LIST_ITEM); | ||
}); | ||
return true; |
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.
I'm confused about this as well. What should be the type returned by onEnter
?
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
6c8828c
to
6a1d06f
Compare
Signed-off-by: irmerk <jolenelanglinais@gmail.com>
if (isSelectionInput(value, CONST.LIST_ITEM) && startBlock.text.length !== 0) { | ||
editor.withoutNormalizing(() => { | ||
event.preventDefault(); | ||
editor.splitBlock().unwrapBlock(CONST.LIST_ITEM).wrapBlock(CONST.LIST_ITEM); |
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.
What is .unwrapBlock(CONST.LIST_ITEM).wrapBlock(CONST.LIST_ITEM) doing on line 37? Why would we unwrap a list item just to wrap it again?
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.
I made this diagram that hopefully helps explain the process. Essentially when splitBlock
is called, there are two child paragraph
nodes under a list_item
. So now the list_item
is acting as if it itself an ul_list
. When unwrapBlock
is called, it moves this new node from the split up one level, but now it is not under a list_item
. So wrapping back puts it under a list_item
which stems from the ol_list
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.
Thanks for explaining this. Makes sense now!
Issue #192
Adjust the handling of lists with the new
paragraph
support inmarkdown-transform v0.8
Changes
onClickBlock
handleronEnter
in the pluginFlags
Persisting issue aroundblock_quote
tolist_item
, requires further workFormatting Toolbar buttons don't yet recognize the selection being in a listSHIFT + ENTER
handling alinebreak
/ newparagraph
in alist_item
is neededRelated Issues