I'm trying to automate the modification of text in an online rich text editor. Here is a similar example of the type of text editor I'm talking about: https://www.slatejs.org/examples/richtext The one I'm dealing with is more sophisticated: it allows you to have links in your text.
I've figured out how to get this RTF text into my clipboard. I've also figured out how to paste my clipboard into the text editor. But, what I haven't figured out is how to modify the RTF in my clipboard in an automated way; I can paste it into Google Docs, modify it by hand, copy it, and then paste it back in, but I don't want to take those manual steps.
To keep it simple, let's say I want to prepend a line that says Link and goes to www.example.org when you click on it. I want the rest of the content to remain the same.
I don't really care what kinds of crazy steps I have to do between having the code in my clipboard and getting the modified version back in my clipboard, so long as it's automated. I'm developing in node.js, so I'd like a solution in that language.
I've been googling for a while now, and I can only find libraries that convert from RTF to something, or vice versa. I haven't found any libraries that actually modify the RTF and keep it as RTF.