I've been wondering if there's a good algorithm to handle highlights in a piece of text. If I highlight some text, lets say the part between the => <= here:
"Idioteque" is a song => by the English rock band Radiohead <=, released on their fourth album, Kid A (2000).
If I want to then edit this text, is there an efficient algorithm for figuring out the start and end index of the highlight for the edited text?