Getting that WYSIWYG editor up and running was a major stumbling block that I overcame to get my school newspaper a PHP-Nuke site ~25 years ago.
It is insane that there isn't a web standard implementation for this passed 15 years ago.
For the longest time browser vendors couldn't even agree on the details of how just text selection should work.
There is contenteditable, which is what all these (Wordgard, ProseMirror) are fundamentally built on. The rest is just the UI, and interop with systems that don't desire arbitrary HTML as input.