Message from JavaScript discussions

September 2020

— 😏


I'm not a pervert to like repositories🤤 the very first star i got was about *if im right you put me a star*

— Can i somehow split node by range?

— <span> test </span


<span> t </span es <span> t </span>

if selection of „es“ given

— You can write a function for that

— Doing so, just curious if there is not anything that already exists

— Gsap made a SplitText module, but that's for animation purposes (to animate any text)

— 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

Message permanent page

— 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