Skip to content

API reference / Common / Engine types / TextParagraphEnd

Type Alias: TextParagraphEnd ​

ts
type TextParagraphEnd = 
  | {
  mark: TextCharacterProperties;
}
  | "none";

How a paragraph ends: with its mark, or not at all.

Mark is every paragraph a file can spell, and the default. None is a state only a merge reaches — one peer deletes a whole paragraph while another types inside it, and the characters typed survive a mark that does not. Usually the next paragraph's \n adopts the orphaned spans, but where no \n follows there is nothing to adopt them: before a Table, whose own unit terminates the block, and at the end of the story.

The distinction is an offset one before it is anything else. The mark is one addressable unit past the paragraph's spans, so a paragraph without one contributes no \n to collect_text and no unit to len — which is what keeps a story offset and a Loro text offset the same number. One with no spans either realizes nothing at all and is not a block.

Transient by construction: export writes </w:p> either way, so a save and reload gives the paragraph its mark back.