targets 에 해당하는 위치의 텍스트를 text 로 모두 교체합니다. Replaces all text at positions corresponding to targets with text .
Parameters:
| Name | Type | Description |
|---|---|---|
| actionName | String액션 이름 | 'replaceTextByIndex' text replacing API |
| text | String교체할 텍스트 | Text to replace |
| targets | Object[] | [{ id: {String}, startIndex: {Number}, endIndex: {Number} }, .....]
|
Example:
| Code Block | ||||
|---|---|---|---|---|
| ||||
editor.execCommand('replaceTextByIndex', 'text', [
{ id: 'paragraphId1', startIndex: 0, endIndex: 3 },
{ id: 'paragraphId2', startIndex: 5, endIndex: 15 }
]); |
...