I need to highlight the differences between two simple strings with python, enclosing the differing substrings in a HTML span attribute. So I'm looking for a simple way to implement the function illustrated by the following example:
hightlight_diff('Hello world','HeXXo world','red')
...it should return the string:
'He<span style="color:red">XX</span>o world'
I have googled and seen difflib mentioned, but it's supposed to be obsolete and I haven't found any good simple demo.