Skip to content

API reference / Common / Engine types / TextParagraph

Interface: TextParagraph ​

A paragraph (a:p, CT_TextParagraph): its paragraph-level properties, the character properties of its paragraph mark, and the spans that carry the content.

A paragraph normally ends with an implicit paragraph mark — one addressable unit past its spans — so a caret can rest in an empty paragraph and a paragraph split/merge is a plain insert/delete across that boundary. Hence len is the spans' total plus one, and an empty paragraph has length 1. A paragraph with no end has no such unit and no such +1.

Properties ​

PropertyDescription
properties
TextParagraphProperties
a:pPr — paragraph-level properties. A property of the paragraph, not of its mark, and kept here whatever becomes of end: which unit the CRDT hangs these on is the codec's choice and has changed before.
end?
TextParagraphEnd
How the paragraph ends — with its mark, or not at all. See [TextParagraphEnd] for what each means and where None comes from.
spans
TextSpan[]
The spans, in order.