Replies: 2 comments 4 replies
-
Editor.js hands such tasks internally and doesn't provide public methods for this. We have a Caret API, with some methods for moving caret to a particular Block. What you're described it could be implemented using native js method for Selection. If you have some example of use cases, please share. |
Beta Was this translation helpful? Give feedback.
-
"This is example of react app , return "Updatetext " when , text is selected by user in Editer.js !" so we can perform any function to take that "text" as input and "processs it " and return to same place , i am working with open AI api to get some magic! toolcode:
} export default CustomReplaceTool; import to main program : import ConsoleTool from '../LoggedinComponents/customtool/consoletool'; const EditorComponent = () => { const initializeEditor = (data) => {
|
Beta Was this translation helpful? Give feedback.
-
Maybe I missed it in the docs. There's quite a bit about blocks, inline tools, etc. but I don't see an API for common things.
How do we get the selected text?
How would we get all the text from the current caret location back to the start of the document?
How do we insert text at the caret location? (even if in the middle of a block)
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions