Type Editor / @type-editor/changeset / simplify-changes/get-text / getText
Function: getText()
ts
function getText(fragment, start, end): string;Defined in: simplify-changes/get-text.ts:16
Extracts text content from a document fragment range.
Converts a range of document nodes into a string representation for character-level analysis. Non-text elements (images, widgets, etc.) are represented as spaces to prevent them from being considered part of words.
Parameters
| Parameter | Type | Description |
|---|---|---|
fragment | Fragment | The document fragment to extract text from. |
start | number | The start position of the range (inclusive). |
end | number | The end position of the range (exclusive). |
Returns
string
The text content with non-text nodes replaced by spaces.