Skip to content

API reference / Common / Engine types / TextStoryPointer

Interface: TextStoryPointer ​

Where a command or a selection points in a story's text: an offset, and the innermost markup it is in.

A container brings no characters of its own, so inside and outside a boundary are one offset: in a[X: bc]d, offset 1 is both before X and at the start of its content. The markup says which. It is read only at a boundary. Where no markup ends or begins at the offset, the pointer is in what is around it, and its markup isn't read. Where some does — span markup around the unit before the offset and not the unit after, or the other way round, or block markup ending or opening at a paragraph's start — markup names the innermost of those the pointer is in, and with it every one around it on that side. None, or an id that is none of them, puts the pointer in none of them: in the markup around both sides alone. See the Text Model design doc.

A pointer is in content controls, custom XML, smart tags and binding places; never in a record, since what is written into a tracked change comes out of it, nor in a choice, which holds its options alone.

Properties ​

PropertyDescription
offset
number
Where it points, in the story's units.
markup?
string
The innermost markup it is in; None, in the story itself — or, where no markup ends or begins at offset, in what is around it.