When Decoration.inline wrap a inline node

I have a link type defined by node schema not mark, when i create a selection and use Decoration.inline wrap the selection from text node to link node with class attr , it will create classname both at a label and span label, what i expect is that classname show at span label only


however, if i select from right to left, it looks good


why is there such a difference?

Does this patch help with this? I didn’t try to reproduce your setup, but applying the styles to multiple levels is something that I didn’t intend to happen.