I am looking to replace a selected text with multiple lines, but I am unable to find the exact solution in the documentation or stackoverflow.
Here is my code:
editor.update(() => {
const paragraphNode = $createParagraphNode();
const newNode = $createTextNode(popoverContent);
paragraphNode.append(newNode);
// How can I replace the selected nodes/text with paragraphNode? \*/
});
This is the input from Editor, first line of a
is not selected
ab
cde
fghi
jklmn
I want to exclude the letter "a" from the replacement process. Could someone please provide guidance on how to achieve this?