Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, as far as I can tell, Quill doesn't have a document model as such. It only has a flat sequence of deltas, which are runs of text with associated formatting attributes.

ProseMirror, on the other hand, explicitly defines a document model as part of its API, arranged as a tree (DAG). This implies you can do things like represent LaTeX natively without having to flatten it, thus preserving the original structure. For example, an entire \section or \chapter could be a single node. (I don't know if this works in practice.) In theory, its design doesn't require a hard distinction between "text" and "embeds" because everything is both.

The benefit is that don't need a complicated, potentially lossy translation between the flat and non-flat versions. For example, if you're doing LaTeX, and there's a \title and \author in the document, you could keep this around as non-visible nodes that are preserved in the model and get serialized back when you export the edited document. (To be fair, I don't know if Quill supports invisible embeds, perhaps it does?)



Most editors nowadays maintain a parallel structure to the DOM. And since the DOM is a tree, that structure is also a tree. Quill's is Parchment[1] and goes a step further by also having an API and allow defining new nodes, which ProseMirror (and maybe Draft) also does.

Deltas are a simple, iterable output format for Quill. In practice it is much nicer to deal with this in many use cases than the Parchment tree.

[1] https://github.com/quilljs/parchment




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: