I am trying to add a span tag dynamically with some styling using editor.insertContent method
editor.insertContent('<span style="color: red;">hello</span> ');
I am adding in the end because if I don't add it and if I type new text after that it is going inside that span and getting styled as per that.
But if I want to add a comma or fullstop just after "hello" without space I am not able to do it since as soon as I delete space after hello it gets styled red.
Example link - https://fiddle.tiny.cloud/1dmG5ckf4a/2
Solutions Tried -
Expected Outcome - after inserting content dynamically new text should go outside the block which was inserted and editor styling should be resetted back to default.
TinyMCE version - v7.3.0
You can add zero width space ​
instead of
to make it working.