My application requires heavy use of ranges (https://developer.mozilla.org/en/DOM/range). In particular, users frequently highlight text and then manipulate it. Sometimes users accidentally highlight text that includes a fragment of a word, and this produces weird results.
I'd like to be able to, given a range, check to see whether it starts or ends in the middle of a word and then, if it does, expand it so that it includes the entire word which it started / ended in the middle of.