slab / delta

Simple and expressive JSON format for describing rich-text content and their changes
https://quilljs.com/docs/delta
BSD 3-Clause "New" or "Revised" License
914 stars 130 forks source link

Definition of "document" vs "non-document" delta #81

Closed x11x closed 2 years ago

x11x commented 2 years ago

Hi,

Am I correct in understanding that a "document" delta is one which contains only "insert" operations? Are there additional constraints? i.e. it must end with a newline? A "non-document" is the inverse?

I can't find this documented anywhere. Do you think it would be worth adding a sentence or two explaining this distinction at the start of the Readme somewhere, since the API docs refer to "document" and "non-document" deltas?

Thanks

jhchen commented 2 years ago

It's meant to be explained in the third paragraph of the Readme. A non-document is simply a delta that is not a document. So it does not only have inserts.