jpuri / draftjs-to-html

Library for converting Draftjs editor content state to HTML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generating unnecessary tags for nested inline style

zhyupe opened this issue · comments

This happens given the following input:

aaabbbaaa

The excepted output is

<p><em>aaa<strong>bbb</strong>aaa</em></p>

Actual output:

<p><em>aaa</em><strong><em>bbb</em></strong><em>aaa</em></p>

@zhyupe : the algorithm parses html not as tree / nested structure but rather as flat structure and it results in flat inline style tags. I do not plan to change that, I will have to come up with new algo for tree traversal for that 😞

commented

@jpuri any update on this?