Keep selection functionality

I would like to keep the selection made on plugin by HTML or URL encoding.
I hope you find it useful.