convertToHTML returns empty <p></p> when editor has no content...how do I get it to return empty string?
hgezim opened this issue · 2 comments
hgezim commented
Currently, if editor has no content, convertToHTML
returns an empty <p></p>
. How do I get it to return an empty string?
Makes no sense to have a bunch of <p></p>
s in the database.
Thoughts?
VitorRibeiroCustodio commented
Not sure if you already fixed this. But you can try this for solving it:
blockToHTML: (block: ContentBlock) => {
if (block.type === 'unstyled') {
return {
start: '',
end: '',
};
}
return undefined;
},
VitorRibeiroCustodio commented
But this way it won't preserve spaces when parsing back, i'm trying to solve that.