Lists
There are two types of lists: bulleted_list
and numbered_list
.
The bulleted list is rendered using <ul />
tag while the numbered list is rendered using <ol />
tag. In turn, all the list items are rendered using <li />
tag.
How parser interprets list items?
All the consecutive list items having same list type are clubbed together and then send off to be rendered.
ℹ️
usePreParser
hook should be used to fetch all the nested items for the nested lists.
The element receives text
and key
as parameter and should return node type value.
ℹ️
Node Type Value is anything that can be rendered: numbers, strings, elements or an array.
Pre-Defined Syntax
blocks: {
list_item: (text, key) => <li key={key}>{text}</li>,
bulleted_list: (text, key) => <ul key={key}>{text}</ul>,
numbered_list: (text, key) => <ol key={key}>{text}</ol>,
}