We’re working on a way of generically modelling form elements in a way which preserves first-class interactions with text fields. The approach we’re taking is similar to the footnote example, in that we’re instantiating entirely separate editors for child nodes that represent text content, and passing node updates across the editor boundary via a NodeView.
We’ve gotten by having a generic schema in the child editor, but this has been working, I think, by coincidence, and we’ve a few bugs that have been explained by this problem. We’ve fixed it by having a properly-formed schema for parent and child, and translating incoming nodes (for updating children) and outgoing transactions (for updating the parent) into the recipients schema.
The way we’re doing this is odd, and I suspect, a bit slow – we’re serialising the node or transaction step in question, and re-parsing it with the appropriate schema. So when passing a node to a child, we serialise it and parse it with the child schema, at which point everything works correctly.
Might there be a better way of doing this translation, that doesn’t involve an intermediate representation (e.g. JSON, DOM nodes?)