Hacker News new | ask | show | jobs
by egonschiele 1108 days ago
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?

1 comments

There's way too little detail given in this question for you to get a useful answer. How is the text stored? How are you highlighting if you don't have the indices?