Hi all,
we are doing a Scripting Editor, based on Prosemirror. In order to keep some metadata around the Semantic Nodes, we thought of saving those in ProseMirror Attributes. So my questions:
Q1: Is that the normal approach for saving metadata in the ProseMirror document model?
Q2: Do ProseMirror Attributes support hierarchical JSON structures?
i.e.
Yes, storing additional data in attributes is what they are for. Attribute values may be anything that’s JSON-serializeable (to make sure toJSON/fromJSON continue to work on the nodes).
we started using the Attrs with hierarchical json and it does work very nice! The PM engine is just great and a really nicely designed thing! We are inspired by it