Message from JavaScript discussions

September 2020

— Well, i am struggling with this


I am creating simple wysiwyg editor without document.execcommand and i need to be able to remove bold / styled text

— You can do selection -> range -> surround to add for example <b> across ur selection

— But how would i remove it then?

— Only idea that i've got is to check if selection range starts and ends in the same node, and if it does, split it the way i've shown above

Message permanent page

— If it does not, you can simply extractContents() and paste them as plain text

— Not entirely sure how will this work with italics and so on lol

— Any better ideas? 😖

— There is no simple WYSIWYG editor, all that is quite complex UI blocks.. more demotivation will follow..

Message permanent page

— I know, i only need the Bold italics text thing

— I bet you are trying to speedrun the minefield🤤 sit down, have some tea, relax..

— Bruh