-
-
Notifications
You must be signed in to change notification settings - Fork 614
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
volto-slate does not properly support "list in list" as generated by Plone Classic #4538
Comments
Here's a page with sublists as a sample: https://climate-adapt.eea.europa.eu/en/eu-adaptation-policy/strategy |
this is "expected behavior" because According to the TinyMCE generated markup, they should be inline. |
@tiberiuichim What do you mean that they should be inline according to the TinyMCE markup? The TinyMCE markup for nested lists is correct (there is a similar example at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul) but lists and list items are block-level elements in HTML, not inline -- https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements |
@davisagli I agree, it's just that I need to understand how to align the expectations of slate vs our internal model. The problem we're hitting one of these two conditions: https://github.com/ianstormtaylor/slate/blob/1d8010be8500ef5c98dbd4179354db1986d5c8f4/packages/slate/src/create-editor.ts#L236-L237C13 Basically, for an element So, in my screenshot, when Slate is normalizing the parent |
This comment from slate code is a bit head-scratching, as it seems to contradict the Mozilla examples:
|
@tiberiuichim I think it means we have to turn
into the slate equivalent of
so that the text is not parented by a node that contains both block-level and inline elements. |
@davisagli as an additional piece of information, volto-slate uses almost exclusively Element nodes (blocks), but declares them to be "inline", for example https://github.com/plone/volto/blob/master/packages/volto-slate/src/editor/plugins/Link/extensions.js#L11 |
yes. Let's see if we can avoid this, I'm afraid that if we introduce another node we may make it weird to navigate and format things in lists. I think I should test this. |
In Plone classic, create a list in a list in a richtext field. This is how do to it:
The generated HTML is:
Notice that the sublist is a part of the list item.
If you try the same thing with Volto (you can increate the level of the elements using the Tab key at the beginning of the list item), you'll get the following markup:
If you copy the rendered markup of the Plone Classic above list and paste it in a Volto block, it will "silently eat" the sublist. If you generate the proper slate structure (using code from the plone.volto slate support PR), everything will appear to be working, but when you try to do any editing on the text block, the sublist will be swallowed.
The text was updated successfully, but these errors were encountered: