I am using the solution found in post but I'd like to be able to not extend the selection if the selection includes a space, instead I would like it shrunk to the word. Is this possible without using rangy, I would really rather not bring in another library just to handle this?