[closed] Empty mark inside <a> gets lost

“a” & “i” are defined as marks in my editor.

<a href="">some text</a> --> works well
<a href=""><i class="..."></i>some text</a> --> removes <i> tag
<a href=""><i class="...">xx</i>some text</a> --> does not remove <i> tag

Prosemirror deletes empty marks which makes sense to me. How can I define in schema to allow empty marks inside “a”?

You can’t. In ProseMirror documents, marks are things applied to other nodes, not nodes with their own content, so they can’t exist empty.

I see, thanks Marjin. For this case, edit a button with icon and text, I will write another small edit function.