How do I replace CKEditor text inside a rte-webpart?

14 Views Asked by At

I have a Sharepoint rte-webpart with a CKEditor to write an article. What I want to do is highlight text within this CKEditor and press a button in a seperate Fluent UI panel to replace the highlighted text with some other text. However I'm not sure how to do this.

I tried checking the < p > tag's parent nodes to check the classes and see if they were a rte-webpart or if it was ck-content but I don't know if this approach is correct.

I did import { CKEditor } from "@ckeditor/ckeditor5-react" and import ClassicEditor from "@ckeditor/ckeditor5-build-classic" but I don't know how to use these or if I need to use them at all.

I'm a beginner so I'm not sure what I have to do in order to reach the desired result.

Thanks in advance!

0

There are 0 best solutions below