Conversion between ProseMirror and unified syntax trees

Given the overlap between ProseMirror’s content model and the syntax trees in the unified ecosystem, has anyone looked into a conversion between these ASTs and ProseMirror documents?

1 Like

Bit of an old topic, but I’ve recently been interested in the same thing and discovered this prosemirror-unified library which looks really useful. They have an implementation for remark called prosemirror-remark essentially serving as a decent reference for other implementations. It all looks really clean.

My use case for this is that I basically have two backend systems, one that stores data in CommonMark with some custom syntax for things like @mentions, etc. and the other that stores data in HTML but with some custom elements that get dynamically parsed into plain links and images when rendering. And so I’d like to build an editor to interface with both using a common set of features.