Honestly I don’t do anything with decorations. I looked into the documentation and didn’t really find an example. So does this mean I have to write a plugin which create the decorations depending on marks added and group them together to inline decoration? How do I get rid of the nested DOM?
So it’s technically possible to have an editor with different decorations (font, fontsize, color, …) and persist them in the document model? I mean the app I saw made it work somehow, I just dont know how to do it.
I think I would get it work on the rendering side (display the document). But not on the editor side, because decorations only used on the view, not state.
I’m surprised no one other expierence that issue, because an editor with fontFamily, fontSize, color seems a common usecase.
On the editing side, I would let ProseMirror handle these issues. I have a similar case, where I need to combine several marks in the original document (which I persist just as a JSON-encoded string) to a specific single style command in the (TeX) output.
For this, I parse the JSON-encoded string in PHP and render my output using
I found ProseMirror to be compelling because its focus is on structure and content rather than styling, unlike most WYSIWYG editors. It was much easier to find editors - mostly even packaged as drop-in ready - that only offer editing with arbitrary styling. Those editors serve that common use case, and only that use case. I suspect that one result of this is that ProseMirror is disproportionately used by people with other use cases, who would not run into the issue you’re having. I know that in my case, I’m using ProseMirror specifically to prohibit that kind of thing.