I will parse span
tags with style
as textStyle
marks, which may include multiple attributes like color
, font-family
, background-color
, etc.
For instance, in the following content, where the text contains TextStyle[green, fontFamily]
, Bold
, and TextStyle[red]
, the final rendered text ends up being bold and red, but the fontFamily
is lost.
<p>
<span style="color: green; font-family: Comic Sans MS, Comic Sans">
<strong>
<span style="color: red">
expect to be red, bold, and have a font-family applied.
</span>
</strong>
expect to be green and have a font-family applied.
</span>
</p>
I have tried using excludes: ''
, but it might lead to unnecessary deeply nested DOM structures.
Is it possible to merge marks of the same type sequentially according to their order, instead of discarding them? This might result in more expected outcomes during editor initialization and when pasting content.