Disclaimer: I know nothing about diff algorithms. If what we have now is the best there is, I apologize in advance.
Sometimes (read: oftentimes) the diff highlighting in the revision history is really weird. For example:
Now in order to save one
: the system interprets the entire link as having been removed and replaced, instead of the understanding that all that was added was
Or how about this one, from one of SO's all time favorites:
Now, it could have realized that what was really important was the sentence underlined in blue. Instead, it chose to take (seemingly random) chunks from different parts of the paragraph. (You could possibly argue that it took the wrong
is not a because it looked for the first occurrence of that string, but that reason fails to explain why it selected things after the actual target sentence.)
Not knowing anything about diffs, if it was possible to have a word match together with the punctuation following it, without the punctuation being necessary for the match, that would solve most of the punctuation problems. For the example in the question that Jeff brought), the
: would be considered an optional part of the previous word ("get"). Right now it seems like it deliberately ignores an immediately following punctuation mark and goes for the next available one.
In order to better see and understand what was changed in revision history, is it possible to get a better diff algorithm implemented? If not, could someone at least explain to me why it works like this?