Rich-text editors are not textareas with bold buttons.
They are document systems: schemas, selections, history, identity, comments, embeds, collaboration, import/export, and recovery paths.
The toolbar is the easy part. The product system underneath is where the complexity lives.