Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

targets  에 해당하는 위치의 텍스트를 text 로 모두 교체합니다. Replaces all text at positions corresponding to targets with text .


Parameters:

NameTypeDescription
actionNameString액션 이름'replaceTextByIndex' text replacing API
textString교체할 텍스트Text to replace
targetsObject[]

[{ id: {String}, startIndex: {Number}, endIndex: {Number} }, .....]

  • id: Paragraph Id
  • startIndex: 변경할 텍스트의 start index start index of the text to replace
  • endIndex: 변경할 텍스트의 end index end index of the text to replace


Example:

Code Block
languagejs
themeEmacs
editor.execCommand('replaceTextByIndex', 'text', [
	{ id: 'paragraphId1', startIndex: 0, endIndex: 3 },
	{ id: 'paragraphId2', startIndex: 5, endIndex: 15 }
]);

...