Code here takes a DOM Selection Range instance and starts traversing a DOM starting from startContainer
up to endContainer
and wraps Text
elements with elements that have semi-transparent background & swaps img
elements with clones that are styled to have semi-transparent yellow overlay.
- Only handles selecting text and images & would not cover divs with backgrounds for instance.