Skip to content

API reference / Common / Engine types / TextControlSpan

Interface: TextControlSpan ​

A span-level structured document tag / content control (docx w:sdt, CT_SdtRun) — the same construct as TextControlBlock at the level below, wrapping spans rather than blocks.

The extent is not in the text. Like the block level, a control wraps a range rather than occupying one: the CRDT carries it as a mark over the characters its spans realize, keyed by the control's own ContentControlId. What differs is the shape the range must have — a span-level control's must lie inside a single paragraph, so a range that comes to span a paragraph mark after a concurrent Enter is trimmed back to its opening paragraph at decode. See Text Model.

Properties ​

PropertyDescription
control
ContentControl
w:sdtPr + w:sdtEndPr — what the control is. The same type the block level carries, because the schema's is: CT_SdtBlock and CT_SdtRun differ only in the content they admit.
spans?
TextSpan[]
w:sdtContent (CT_SdtContentRun) — the spans it wraps, in the parent paragraph's offset space. Never empty, as TextControlBlock::blocks is not — and it is the span level that makes the rule bite, since an "empty" inline control is the common one. Word's is not empty either: it holds its placeholder text, which typing replaces.