Page tree
Skip to end of metadata
Go to start of metadata

Replaces all text at positions corresponding to targets with text .


Parameters:

NameTypeDescription
actionNameString'replaceTextByIndex' text replacing API
textStringText to replace
targetsObject[]

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

  • id: Paragraph Id
  • startIndex: start index of the text to replace
  • endIndex: end index of the text to replace


Example:

editor.execCommand('replaceTextByIndex', 'text', [
	{ id: 'paragraphId1', startIndex: 0, endIndex: 3 },
	{ id: 'paragraphId2', startIndex: 5, endIndex: 15 }
]);
  • No labels