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

To put it in a different perspective, plain text editing has well-solved CRDT patterns. But, semantic data-structures like rich-text or syntax trees is what's tricky and has unsolved challenges.

Peritext[1] is the only one that came close to solving rich-text, but even that one left out important aspect of rich-text editing like handling list & table operations as "work to be done later".

For people interested on why it's difficult to build CRDTs for richtext, here's a piece I wrote a year back: https://writer.zohopublic.com/writer/published/grcwy5c699d67...

Related HN discussion: https://news.ycombinator.com/item?id=29433896

[1] https://github.com/inkandswitch/peritext



> semantic data-structures like rich-text or syntax trees is what's tricky and has unsolved challenges.

Yrs developer here:

- Yjs/Yrs have support for formatting attributes[1]. The matter if format attributes conflict resolution behaves as user desired is a subject to discussion (which is a common thing re. CRDTs and their trade offs), but its behaviour is consistent, convergent and algorithm itself works fast. This feature is in fact used in many rich text editors using Yjs bindings.

- Embedding non-string elements in text is supported as well.

- While syntax trees are not supported out of the box (AFAIK this CRDT is still being researched), Yjs also support XML nodes with attributes and nested children, which may be used for similar effects in some scenarios.

[1] https://docs.yjs.dev/api/delta-format




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

Search: