Repository logo
 

Peritext: A CRDT for Collaborative Rich Text Editing

Published version
Peer-reviewed

Type

Article

Change log

Authors

Litt, G 
Lim, S 
Van Hardenberg, P 

Abstract

jats:pConflict-Free Replicated Data Types (CRDTs) support decentralized collaborative editing of shared data, enabling peer-to-peer sharing and flexible branching and merging workflows. While there is extensive work on CRDTs for plain text, much less is known about CRDTs for rich text with formatting. No algorithms have been published, and existing open-source implementations do not always preserve user intent.</jats:p> jats:pIn this paper, we describe a model of intent preservation in rich text editing, developed through a series of concurrent editing scenarios. We then describe Peritext, a CRDT algorithm for rich text that satisfies the criteria of our model. The key idea is to store formatting spans alongside the plaintext character sequence, linked to a stable identifier for the first and last character of each span, and then to derive the final formatted text from these spans in a deterministic way that ensures concurrent operations commute.</jats:p> jats:pWe have prototyped our algorithm in TypeScript, validated it using randomized property-based testing, and integrated it with an editor UI. We also prove that our algorithm ensures convergence, and demonstrate its causality preservation and intention preservation properties.</jats:p>

Description

Keywords

4606 Distributed Computing and Systems Software, 46 Information and Computing Sciences

Journal Title

Proceedings of the ACM on Human-Computer Interaction

Conference Name

Journal ISSN

2573-0142
2573-0142

Volume Title

6

Publisher

Association for Computing Machinery (ACM)
Sponsorship
Isaac Newton Trust (19.08(m))
Leverhulme Trust (ECF-2019-028)
Notion, Leverhulme Trust, Isaac Newton Trust, Nokia Bell Labs
Relationships
Is supplemented by: