Takes an array of blocks and returns an array of nodes optimized for rendering in HTML-like
environment, where lists are nested inside of eachother instead of appearing "flat" as in
native Portable Text data structures.
Note that the list node is not a native Portable Text node type, and thus is represented
using the @list type name ({_type: '@list'}).
The nesting can be configured in two modes:
direct: deeper list nodes will appear as a direct child of the parent list
html, deeper list nodes will appear as a child of the last list item in the parent list
Takes an array of blocks and returns an array of nodes optimized for rendering in HTML-like environment, where lists are nested inside of eachother instead of appearing "flat" as in native Portable Text data structures.
Note that the list node is not a native Portable Text node type, and thus is represented using the
@list
type name ({_type: '@list'}
).The nesting can be configured in two modes:
direct
: deeper list nodes will appear as a direct child of the parent listhtml
, deeper list nodes will appear as a child of the last list item in the parent listWhen using
direct
, all list nodes will be of type ToolkitPortableTextDirectList, while withhtml
they will be of type ToolkitPortableTextHtmlListThese modes are available as LIST_NEST_MODE_HTML and LIST_NEST_MODE_DIRECT.