Y-prosemirror: yDoc may contain illegal data

yjs does not aware of ProseMirror schema rules, so after merging two transactions, yDoc may contain data that break the schema rule. Is there any way to ensure that the yDoc is valid to ProseMirror schema?

For example, we can define some rules in ProseMirror schema, like marks excludes another.

marks: {
  em: {
    excludes: 'strong',
    parseDOM: [{ tag: 'i' }],
    toDOM() { return ['em', 0] }
  strong: {
    excludes: 'em',
    parseDOM: [{ tag: 'strong' }],
    toDOM() { return ['strong', 0] }

Two users open the same doc with content ABC.
User1: Add em mark to AB.
User2: Add strong mark to BC.

Two updates broadcast to each other. So the yDoc is <em> -> A -> <strong> -> B -> </em> -> C -> </strong>. B is in strong and em marks, which is not valid in ProseMirror.