views:

487

answers:

2

It appears Python's difflib.HtmlDiff, rather than using INS and DEL, uses SPAN elements with custom classes:

python -c 'import difflib; txt1 = "lorem ipsum\ndolor sit amet".splitlines(); txt2 = "lorem foo isum\ndolor amet".splitlines(); d = difflib.HtmlDiff(); print d.make_table(txt1, txt2)'

Before I go about fixing this myself, has anyone looked into this already? Is there perhaps a valid reason for not using POSH? (Google wasn't a big help here... )

+2  A: 

The python bug tracker is here: http://bugs.python.org/

There's no open bug on this issue, which I guess is because most people would not care what sort of html it is as long as it works. If it's important to you, file a bug and submit a patch.

Paul Hankin
Thanks. However, I think changing the markup now would be a problem WRT backwards compatibility...
AnC
+2  A: 

This script by Aaron Swartz uses difflib to output ins/del.

Yang