Open woozI43 opened 4 years ago
The only 'highlighting' of text i am aware of is setting the selected text's background color (by default to yellow). Do you mean that?
This can be done by:
editor.javaScriptExecutor.setTextBackgroundColor(<color>)
But the problem here is that it just sets selected text's background color, and i don't know how to select a text programmaticly.
As under the hood RichTextEditor is using a HTML 5 editor (by setting contenteditable to true), you may there find a way to do it: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
Im applying a tts functionality on the text editor and I want to highlight and set focus on the word that is speaking. How can I do that programmatically? I know there is a command in the toolbar that highlights the text but I want to know the code.