const initialValue = '<p><span style="font-size:36px;"><span style="color:#00ff22;"><span style="background-color:#77b9c9;">hhkjhk hkjhkjh hjkhkj</span></span></span></p>'
DOMParser.fromSchema(schema).parse(document.createRange().createContextualFragment(initialValue))
I have tried to parse the below HTML string using the above code
<p>
<span style="font-size:36px;">
<span style="background-color:#77b9c9;">
<span style="color:#00ff22;">world !!!</span>
</span>
</span>
</p>
but I got
<p>
<span style="color:#00ff22;">world !!!</span>
</p>
The issue is some of the span tags were removed even if it has style tag in it
how do achieve the exact HTML without losing some span tags? please help me with the necessary schema