The default (nested length 0) renders the <li> but no <ol> or </ol> which means every subsequent list will continue the numbering order after the last <li> in the DOM. If I had an <ul> before hand it would not start at 1.
The first nesting level renders the <ol> and </ol> tags correctly but removes my styles.
The second nested level renders a <ol><li></li></ol> for each block which means the numbering resets for each block.
I am just trying to mimic the functionality as seen in the DraftJS editor on the left.
If I remove any checking for list blocks in the convertToHTML section my lists are rendered correctly in the dom but are not styled and have no bullet points (list-style-type css property).
Ive tried the following three methods:
This is the output:
This is the DOM:
As you can see:
<li>
but no<ol>
or</ol>
which means every subsequent list will continue the numbering order after the last<li>
in the DOM. If I had an<ul>
before hand it would not start at 1.<ol>
and</ol>
tags correctly but removes my styles.<ol><li></li></ol>
for each block which means the numbering resets for each block.I am just trying to mimic the functionality as seen in the DraftJS editor on the left. If I remove any checking for list blocks in the
convertToHTML
section my lists are rendered correctly in the dom but are not styled and have no bullet points (list-style-type css property).