What is the recommended way of representing range shaped information such as comments?
From what I’m gathered,
- Decorations: make it easier to model cross-node content and are correctly not part of the document (so you don’t have to filter them out when serializing it), BUT don’t work out of the box with redo/undo operations, nor copy/paste operations (and likely harder to integrate into collab operations, too)
- Marks: recommend for inline-nodes, but block-nodes are allowed (assuming @marijn hasn’t changed his mind) and if you use them for ranged-information you get redo/undo, copy/paste, and collab all working out of the box, BUT you’ll have to filter them out when serializing the document
Both decorations and marks: you have to manually change the element (i.e.
spandepending on whether it’s wrapping block or inline content, if both are a requirement
From previous discussions, it seems like Marjin recommends going the decoration approach (likely due to the ambiguity around block-level marks). The collab example on the site also uses this approach as well, though its use-case is quite simple.
However, unless there are other factors I’m not considering (please weigh in), you seem to get more out of the box if you implemented range related features it via marks. So I’d love to know where people are at with this.