Closed maxwellskala closed 4 years ago
Any reason why this is not working for me? I updated the package and see the updated code, but i don't get a type on the <ol>
at all. this is my blockToHTML code
blockToHTML: (block) => {
if (block.type.includes('unstyled') && block.text === '') {
return <br />;
}
if (block.type.includes('align')) {
return alignToElement[block.type];
}
return undefined;
},
it falls on the undefined meaning convertToHTML will take care of it, but i only get new <ol>
no type in them.
draft-js strips standard ordered list styling using CSS and applies its own list indices using
:before
pseudo-elements. These indices matchtype
attributes that can be applied to<ol />
elements, butconvertToHTML
does not currently apply thesetype
attributes when converting nested ordered lists.This PR applies the
type
attribute based on list depth so that HTML-serialized Draft content more closely matches what the editor renders.