You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deserializing some html so that it can be used with a slatejs editor inner list-items are lost. Using the following sample html:
<ol>
<li>
one
<ol>
<li>
two
</li>
</ol>
</li>
</ol>
Here, the ordered list within the list-item containing "one" will be lost as this seems to be part of the slate architecture.
Looking at the above sample code, wrapping the "one" in a div (as part of the deserialization process) will preserve the inner ordered list, but now the list slate-list-plugin will not work as intended - the plugin will not allow you to add or remove new list-items and does not seem to recognize the structure as a list because the inner list-item "two" will now also be wrapped in a div.
When loading some Value like the following into the editor, however, everything works as intended and the above issue is not encountered (like in the example):
Was looking through the codebase for a sample deserialization method but could not find one, but this seems to be an issue with deserialization.
The text was updated successfully, but these errors were encountered:
barrymun
changed the title
Deserialization results in the loss of an inner list item
Deserialization results in broken plugin functionality
May 8, 2019
When deserializing some html so that it can be used with a slatejs editor inner list-items are lost. Using the following sample html:
Here, the ordered list within the list-item containing "one" will be lost as this seems to be part of the slate architecture.
Looking at the above sample code, wrapping the "one" in a div (as part of the deserialization process) will preserve the inner ordered list, but now the list slate-list-plugin will not work as intended - the plugin will not allow you to add or remove new list-items and does not seem to recognize the structure as a list because the inner list-item "two" will now also be wrapped in a div.
When loading some Value like the following into the editor, however, everything works as intended and the above issue is not encountered (like in the example):
{"object":"value","document":{"object":"document","data":{},"nodes":[{"object":"block","type":"ordered-list","data":{},"nodes":[{"object":"block","type":"list-item","data":{},"nodes":[{"object":"block","type":"list-item-child","data":{},"nodes":[{"object":"text","leaves":[{"object":"leaf","text":"one","marks":[]}]}]},{"object":"block","type":"ordered-list","data":{},"nodes":[{"object":"block","type":"list-item","data":{},"nodes":[{"object":"block","type":"list-item-child","data":{},"nodes":[{"object":"text","leaves":[{"object":"leaf","text":"two","marks":[]}]}]}]}]}]}]}]}}
Was looking through the codebase for a sample deserialization method but could not find one, but this seems to be an issue with deserialization.
The text was updated successfully, but these errors were encountered: