85 posts and 7 images omitted See All
Odd though. Extracting the text content of a selection is not exactly rocket science. Where's the code for that located?
I think the fault in your logic is that you assume that the last selection points to textnodes + text offsets. tripleselect selects to node boundaries, which means the selection contains the parent node + node offsets. which in turn causes your
isInsideto fail since it goes up to the parent element.
>Selection.anchorOffset Read only
> Returns a number representing the offset of the selection's anchor within the anchorNode. If anchorNode is a text node, this is the number of characters within anchorNode preceding the anchor. If anchorNode is an element, this is the number of child nodes of the anchorNode preceding the anchor.
Which means the anchor and focus node can either be text
Nodes or `Element
Makingel = el.parentElement
being a text node might fix it.
CatChan feedback thread.
Any feedback is welcome.
HEY GUYS AND LOOK WHOS HERE
i missed the stream! xdddddddd